Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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?
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
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.
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).
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.