NexusFi: Find Your Edge


Home Menu

 





Over-optimization and Roll Over Dates


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one jamesw with 2 posts (1 thanks)
    2. looks_two tpredictor with 1 posts (1 thanks)
    3. looks_3 ShatteredX with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
      Best Posters
    1. looks_one rleplae with 1 thanks per post
    2. looks_two tpredictor with 1 thanks per post
    3. looks_3 ShatteredX with 1 thanks per post
    4. looks_4 jamesw with 0.5 thanks per post
    1. trending_up 2,906 views
    2. thumb_up 4 thanks given
    3. group 5 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Over-optimization and Roll Over Dates

  #1 (permalink)
 jamesw 
Richmond, VA
 
Experience: Intermediate
Platform: TradeStation, thinkorswim
Trading: Crude CL, Gold GC, Copper HG
Posts: 5 since Jun 2017
Thanks Given: 34
Thanks Received: 2

I am developing a few algorithmic strategies across various indexes. Part of the development is in the optimization of key parameters with walk-forward testing.

I am developing on tradestation. I swing trade and hold my positions often from 7 to 20 days. I am relatively new to this, with about 10 strategies under development.

Part of the development process is the selection of what I am trading (my symbol - like @NGU17) and when I should automate the roll over for back testing (like @NGU17=102XC - roll over 2 days prior to contract expiration). Naturally, I chose the one that gives the optimal result. If it works the best, it must be according to a general pattern for that commodity, right?

This feels like over-optimization, but I am not that familiar with rollover date strategies for different commodities (Gold acts different than Hogs for example; the difference can be significant, even (rarely) the difference between a fairly strong system and a losing system).

For you algorithmic traders, how do you handle this? Do you walk forward test your rollover date also? Or just pick one and run with it?

Is there somewhere to learn about principles related to roll over date strategies?

Any insight to this would be appreciated. Thanks!

JamesW

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
 
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


I think in general you want to be trading in the front month (= contract with highest volume)
I you are swing trading, at a certain point in time, you will need to do something, even if the position is still 'on'

You can :
- close the position when the contract is not longer the front month
- you can trigger a strategy on top of the position which is the best roll (spread..
- you can implement 'black-out' around the roll period if you are in swing

None of this is a silver bullet...

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 tpredictor 
North Carolina
 
Experience: Beginner
Platform: NinjaTrader, Tradestation
Trading: es
Posts: 644 since Nov 2011

I have not dealt much/any with this but I think your system should first be profitable on the continuous or cash. Once you have a profitable system, you can start to work on more implementation aspects like roll over. You should not see a big edge one way or another because the contracts should be arbitraged. So, if you are seeing a big edge then it might be a problem in your backtesting.

If you've already ruled that out, you might want to look at what is causing potential differences. Potential sources to look at are contango, backwardation, whether the trade is in a loss or win, how many trades are impacted, spread, etc.

Let's say you see that rolling over 2 days is better then 1 day, count the number of trades that are split across settings A and B. If fewer trades are split around one of the settings then that could explain it because there is less slippage. The optimization in this case is unlikely to be meaningful going forward.

As for a general strategy for roll over it might look something like this

A trade already in a position that will likely be closed out before roll over. Ideas: You may be better off not rolling over and incurring the extra slippage. If the trade is profitable, hold until expires. If the trade is negative then close and take a loss.

A trade that needs to be opened and will likely go over the roll over date. Consider opening in the next contract so you do not need to roll it over again.

In general, the optimal strategy will be to measure the risk of trading a product with less liquidity and compare that to the cost of roll over. Go with the contract with less liquidity if the risk cost is less then roll over slippage and transaction cost. Go with more roll overs if the cost of trading the less liquid product is more risky.

... Thinking outloud.. in the case where a trade will go over the roll over date, if the next contract has sufficient liquidity such that you are unlikely to experience greater slippage over the current (or even current*2) then you would execute in the next contract or else in the front.

More thinking...

For entry
1. If trade will not go over roll over, trade in front month.
2. If the trade will go over roll over and the back has sufficient liquidity already then open in the back/nearest/next. Volume > X
3. If next doesn't have sufficient liquidity then open in front.

For exit

1. If trade is already near end of life or unprofitable, consider closing vs rolling it over.
2. If trade is profitable, consider re-entry at better price.

Reply With Quote
  #5 (permalink)
 jamesw 
Richmond, VA
 
Experience: Intermediate
Platform: TradeStation, thinkorswim
Trading: Crude CL, Gold GC, Copper HG
Posts: 5 since Jun 2017
Thanks Given: 34
Thanks Received: 2

Kevinkdog (buy his book!) sent me a couple of PM and I realized that I didn't have to use Custom Futures on Tradestation. As some of the previous messages here mentioned, I could just use the continuous front month contract until Tradestation rolls over to the next month, and then adjust. A perfect newbie question.

That brings up why I started using the Custom Futures option to begin with. I am testing some automated strategies with Tradestation, but I am currently a thinkorswim user. I fined TOS makes it simpler to find the actively traded futures contract.

For example, today is 8/9/17:

Today's September 2017 (TOS-/ZCU7; TS - CU17) contracts has an open interest of some 400,000
Today's December 2017 (TOS-/ZCZ7; TS - CZ17) contracts has an open interest of some 615,000. Volume is a bit higher.

TOS has buyers skip September, seemingly every year. It jumps straight from July to December. While December is more liquid, they both seem fairly liquid. TS won't ever let me view Corn continuous contracts for December, so I can't automate it

With Gold TOS has December 2017 as the active contract. TS says that @GCU17 and @GCV17 are not correct signals. I am guessing that is because they are not part of the continuous series, but the Z/December contracts are part of the continuous series.

Maybe I need not be confused, and maybe my confused comes from the baby steps I took with TOS and not wanting to let go of the rails. Still, I don't understand why TS says Corn's current contract is December when TOS says it is October, but when it comes to Gold, they both agree. I am guessing I need to just let it go and use what TS allows (Gold - G, J, M, Q, Z Contracts ; Corn - H, K, N, U, Z Contracts).

Started this thread Reply With Quote
  #6 (permalink)
 ShatteredX 
Houston, TX
 
Experience: Intermediate
Platform: Python
Trading: NQ
Posts: 97 since Apr 2016
Thanks Given: 133
Thanks Received: 96

Yeah, I would definitely NOT optimize your rollover date. You could end up picking a rollover date too early (excessive slippage due to low liquidity) or too late (broker liquidates your position to avoid taking delivery). Plus, I would consider it overfitting your strategy big time.

IMO, every trader needs to verify that their trading software is using realistic rollover dates to create continuous charts.

Example of software with bad rollover dates: NinjaTrader 7. The rollover date for Gold Dec 17 was set as July 31. Guess what? My broker called me up on July 27 and said that my long Gold Aug 17 contract would be liquidated at close on July 28 if I kept the position open. Clearly, the rollover date should've been set to July 27 or 28.

Reply With Quote
Thanked by:




Last Updated on August 10, 2017


© 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