NexusFi: Find Your Edge


Home Menu

 





KJ Trading Systems Kevin Davey - Ask Me Anything (AMA)


Discussion in Trading Reviews and Vendors

Updated
      Top Posters
    1. looks_one kevinkdog with 180 posts (416 thanks)
    2. looks_two SMCJB with 23 posts (40 thanks)
    3. looks_3 Mabi with 17 posts (12 thanks)
    4. looks_4 bluefightingcat with 16 posts (9 thanks)
      Best Posters
    1. looks_one grausch with 2.8 thanks per post
    2. looks_two kevinkdog with 2.3 thanks per post
    3. looks_3 SMCJB with 1.7 thanks per post
    4. looks_4 Big Mike with 1.5 thanks per post
    1. trending_up 170,385 views
    2. thumb_up 649 thanks given
    3. group 111 followers
    1. forum 433 posts
    2. attach_file 15 attachments




Closed Thread
 
Search this Thread

KJ Trading Systems Kevin Davey - Ask Me Anything (AMA)

  #31 (permalink)
 
treydog999's Avatar
 treydog999 
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
Posts: 897 since Jul 2012
Thanks Given: 291
Thanks Received: 1,039

@kevinkdog

Hi kevin. I am wondering about parameter changes in a strategy while you are holding a position. I know your a proponent of walk forward optimization and parameter selection. I am wondering how you deal with open positions especially on live strategies. If the current strategy parameters are holding a position, and you re optimize the strategy for new parameters. Do you just hold the position into the new parameters and allow the strategy to decide to exit or hold based on those new parameters? Or do you exit the position then start with a clean slate into the new optimization window?


Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
Futures True Range Report
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #32 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,645 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338


treydog999 View Post
@kevinkdog

Hi kevin. I am wondering about parameter changes in a strategy while you are holding a position. I know your a proponent of walk forward optimization and parameter selection. I am wondering how you deal with open positions especially on live strategies. If the current strategy parameters are holding a position, and you re optimize the strategy for new parameters. Do you just hold the position into the new parameters and allow the strategy to decide to exit or hold based on those new parameters? Or do you exit the position then start with a clean slate into the new optimization window?

Good question, @treydog999 . A good argument could be made for any of the options you listed. I don;t think there is a right or wrong answer...

That being said, I do option 1. I find that this is the easiest way to match real life trading and walkforward historical strategy.

So, if I am long, and at night I reoptimize, and it tells me to go flat, I will go flat.

Follow me on Twitter
Thanked by:
  #33 (permalink)
 
treydog999's Avatar
 treydog999 
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
Posts: 897 since Jul 2012
Thanks Given: 291
Thanks Received: 1,039


Working on daily bars I am wondering how reliable "setexitonclose" tradestation command has been for you? i feel like its too optimal an exit especially with movements being erratic near the end of the session. I was thinking going to market in the globex session or trying to exit 5 minutes before the close of the session but both would require more complicated code. I think maybe just as a platform to test ideas, setexitonclose is fine but for real world applications its probably not going to work well. Do you have any thoughts on this?

  #34 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,645 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338


treydog999 View Post
Working on daily bars I am wondering how reliable "setexitonclose" tradestation command has been for you? i feel like its too optimal an exit especially with movements being erratic near the end of the session. I was thinking going to market in the globex session or trying to exit 5 minutes before the close of the session but both would require more complicated code. I think maybe just as a platform to test ideas, setexitonclose is fine but for real world applications its probably not going to work well. Do you have any thoughts on this?


A couple of things to keep in mind:

1) SetExitOnClose can NEVER work in real time with standard daily bars, since the order would get send right when the market closes (which means the order is sent too late).

2) For Globex, the last trade time is not the close time. For example, Crude Oil trades until 5 PM every day. BUT, the settlement price is determined at 2:30 PM. Tradestation and Kinetick use the settlement price as the closing price. CQG doesn't. This could mess your strategy up.

3) Instead of SetExitOnClose, try "Sell next bar market" - it is much more realistic. But thin Globex markets at open may give you bad fills.


There are ways to get around this, but solution involve multiple charts, or 1 chart with multiple datastreams, or some other difficult code.

One thing I sometimes do is have a custom session that ends 5 (or any number of) minutes before actual market close. Then I can use SetExitOnClose, because when my session "closes" the daily bar hasn't closed. I use the exact same code on testing AND live trading on my NGEC strategies ( link here). It works great.

Follow me on Twitter
Thanked by:
  #35 (permalink)
 
treydog999's Avatar
 treydog999 
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
Posts: 897 since Jul 2012
Thanks Given: 291
Thanks Received: 1,039

@kevinkdog

I have a question about incubation. I was wondering if you could do incubation by segregating the most recent 3 months of your data from the WFO process. This way you would not have to actually wait 3 months to see the results. For example i have 10 years and 3 months of data. I use 2 years as in sample, randomly selected but not including the last 3 months. I walk forward using the 1st 10 years. then after those results come in i then apply the walk forward parameters to the completely virgin last 3 months. Would this be the same as waiting the 3 months? Logically to me it seems like it since a segregated 3 months and a new 3 months are the same thing to the system. Something its never seen before. I was wondering about your thoughts on that process?

Thanked by:
  #36 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,645 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338


treydog999 View Post
@kevinkdog

I have a question about incubation. I was wondering if you could do incubation by segregating the most recent 3 months of your data from the WFO process. This way you would not have to actually wait 3 months to see the results. For example i have 10 years and 3 months of data. I use 2 years as in sample, randomly selected but not including the last 3 months. I walk forward using the 1st 10 years. then after those results come in i then apply the walk forward parameters to the completely virgin last 3 months. Would this be the same as waiting the 3 months? Logically to me it seems like it since a segregated 3 months and a new 3 months are the same thing to the system. Something its never seen before. I was wondering about your thoughts on that process?

I actually did that with my Combine system. I developed it in March 2013, but only used data through December 2012. Once I was done, I then used the unseen data Jan 2013- Mar 2013 as incubation. This gave me the checks and confidence I needed to trade it in the Combine. But I still wanted to do live incubation, too, and I waited until August 2013 before going live.

Follow me on Twitter
Thanked by:
  #37 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,396 since Jun 2009
Thanks Given: 33,172
Thanks Received: 101,536


treydog999 View Post
@kevinkdog

I have a question about incubation. I was wondering if you could do incubation by segregating the most recent 3 months of your data from the WFO process.

IMO...

The major risk here is not seeing your system trade live. If you've developed hundreds of systems then you probably have a grasp on everything, but for the newer guys, you really must see your system trade live to make sure you've not made programming mistakes that are not visible during backtests or WFO's.

EDIT: Oops I thought this was the "taking a system live" thread, otherwise I would have kept my mouth shut

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread
Thanked by:
  #38 (permalink)
 
treydog999's Avatar
 treydog999 
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
Posts: 897 since Jul 2012
Thanks Given: 291
Thanks Received: 1,039

@kevinkdog

I was wondering when you have a trade that you roll over to the next contract. How do you do it? its very difficult to get the same price on both sides. Do you usually just try to work orders so it gets that way? or just go on both sides at the market and take the new premium as a charge? How do you minimize the effect of contract rollover?

  #39 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,645 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338


treydog999 View Post
@kevinkdog

I was wondering when you have a trade that you roll over to the next contract. How do you do it? its very difficult to get the same price on both sides. Do you usually just try to work orders so it gets that way? or just go on both sides at the market and take the new premium as a charge? How do you minimize the effect of contract rollover?

Great question. If you do it correctly, you don't have to pay a premium, you may have to pay 2 bid/ask spread costs instead of 1, and you'll have to pay the equivalent of 1 round turn commission. A lot of people are under the mistaken impression that they always lose or gain premium during a rollover. While this might be true for strategies such as scale trading, it does not have to be true for algorithmic systems with a simple rollover. I'll explain all of that here, with a real world example.

Let's say I have a system that trades the Euro. I use the back adjusted continuous contract to calculate all parameters for the strategy. I am currently trading the September contract, but let's say I roll to December this afternoon.

Based on the signal from my continuous contract chart, I bought the September contract at 1.3272 a few days ago. Since a few days ago, September was the front month, the continuous contract thinks I entered at 1.3272.

This system has a $625 stop loss, and a $1250 profit target. So, my stop loss is at 1.3222, and my profit target is at 1.3372. Both of those are based on the September contract, which is what was the lead contract a few days ago.

So, now a few days later, I have to roll the position into December. Let's first look at the math, and what happens to the continuous contract, and why I don't lose the premium (difference) between the two contracts when I rollover.

Right at rollover, let's say December was at 1.3303, while September was at 1.3299. This is a difference of .0004, which is what the back adjusted continuous contract needs to know.

To adjust the continuous contract to have December as the front month, you simply have to add .0004 to each price point in the existing continuous contract. So, we do this, and now have a continuous contract with December as the front month.

Now, if you have your trading strategy applied to the updated continuous contract, the strategy will think you bought at 1.3276, with a stop loss at 1.3226 and a profit target of 1.3376.

"But wait!" you say. "I didn't buy at 1.3276. I somehow got screwed!"

So, here's the math, neglecting the bid/ask spread and the commission costs, just for this example.

REAL WORLD

You bought September at 1.3272. You sold September at 1.3299. Profit = $337.50
You bought December at 1.3303. Current price is 1.3303. Profit = $0

So, in the real world, you have a closed profit of $337.50, an open profit of $0.

If your new stop loss gets hit, you will lose (1.3226-1.3303)*125000 = -962.50. Add that to the previously closed profit of $337.50, and your total loss is $625.

If your new profit target gets hit, you will gain (1.3376-1.3303)*125000 = +912.50. Add that to the previously closed profit of $337.50, and your total gain is $1,250.


STRATEGY WORLD

For the original continuous contract scenario, the continuous contract thinks I entered at 1.3272.
This system has a $625 stop loss, and a $1250 profit target. So, my stop loss is at 1.3222, and my profit target is at 1.3372.

For the new rolled over continuous contract scenario, the continuous contract thinks I entered at 1.3276.
This system has a $625 stop loss, and a $1250 profit target. So, my stop loss is at 1.3226, and my profit target is at 1.3376.


So, as you can see, the profit and loss from the real world and the strategy world is exactly the same.


Next post I'll go into details on how the rollover is accomplished.

If this is confusing to anyone, please feel free to ask questions.

Follow me on Twitter
  #40 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,645 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338


Suppose you are long the Sept Euro contract at 1.3222, and it is getting to the time in mid September when you must rollover to the December contract. When you have to perform this rollover in an algorithmic strategy, how do you actually accomplish it? I usually do it one of three different ways. Each one has its advantages and disadvantages.






Method 1: Quick Roll (most expensive typically)

In this approach, you enter a sell order at the market in September Euro, and enter a buy order at the market in December Euro. Since both orders are market orders, they will be immediately executed. Using the prices above, here is the math:

Sell September at 1.3299 (bid price)

Buy December at 1.3304 (ask price)

Closed profit = $962.50 - $5.00 commission = $957.50
Open Profit = Long From 1.3304

Advantages: guaranteed fill, quick, easy

Disadvantages: you pay 2 bid/ask spreads, and if you are not quick with second order, market could run away from you, costing you money.


Method 2: Leg In Roll (cheapest method typically, IF done correctly)

In this approach, you enter a sell order at the market in September Euro, and try to work a buy order at the bid price in December Euro. The sell is immediately executed, and the buy is a limit order, which hopefully will get filled at the price you want. Using the prices above, here is the math:

Sell September at 1.3299 (bid price)

Buy December at 1.3303 (bid price)

Closed profit = $962.50 - $5.00 commission = $957.50
Open Profit = Long from 1.3303

Advantages: you save yourself $12.50 by getting in the December contract 1 tick better than you did with method 1.

Disadvantages: more complicated, plus you may have to chase the market up to get the December fill. You can easily lose more than 1 tick by trying to be too greedy with your limit order.


Method 3: Exchange Supported Spread Roll (cost usually between methods 1 and 2)

The exchanges have a great tool to help spreaders - a dedicated quote feed and tradable symbol for executing spread orders, which is what a rollover is. In this case, you are buying or selling the spread, not the individual legs. You get simultaneously filled on both legs at the same time. Using the prices above, here is the math:

Buy Spread at 4.5 (ask price). Note that this doesn't tell you the actual execution prices. You'll see these on your statement, and they are really irrelevant in the marked to market accounting of futures (the spread price is all that really matters). So, we will just assume some prices, keeping the spread fill price correct:

Sell Sept at 1.3329

Buy Dec at 1.3329+.00045 = 1.33035


Closed profit = $962.50 - $5.00 commission = $957.50
Open Profit = Long from 1.33035

Advantages: simple, no chance of only one leg executing, cost usually in between method 1 and 2.

Disadvantages: Some brokers don't support this. Tradestation's main platform, for example, does not allow this. You can do it manually in Tradestation 4.0 platform, but that platform is not made for algorithmic strategies. It is also easy to screw up the order, and buy the spread instead of selling it. You have to be careful. Also, don't think that just because you are trading the spread symbol, you'll only pay 1 commission. Some people think this is true, and I guess those folks don't read their statements very closely. When the brokerage does its accounting, it splits the spread into a separate buy and sell fill for each leg. When this happens, commission is charged for each. There is no free lunch, commission wise, with this method!


You can see from the above example there is $12.50 cost difference between all 3 methods, with Method #1 being the most expensive, Method #2 being the cheapest, and Method #3 in between the other two. This is not always the case, but is true in general.



So, that is how a rollover is actually accomplished. Whenever I can, I use the exchange supported spreads to do my rollovers. I can do this with systems where I enter orders manually. For my fully automated systems, I generally use method 1, even though it is the most expensive. When I use Method 2, I sometimes find myself chasing the market with my order, or worse yet, I forget about the rollover for a while, leaving me temporarily doubly exposed, until I fix it.

Follow me on Twitter

Closed Thread



Last Updated on July 5, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts