Barcelona
Experience: Beginner
Platform: NinjaTrader 7
Trading: CL, TF
Posts: 8 since Aug 2012
Thanks Given: 5
Thanks Received: 0
|
Hello,
I just checked all Big Mike’s posts but I didn’t find anything that solved this issue, I think. Maybe because it’s a stupid question and it’s something so basic you can do easily with Ninjatrader 7 vanilla options.
The question is… anyone knows if there is a way to switch/rollover from one contract to the next one, based on its DailyVolume or its expiration date in a strategy, running on real-time or market replay?
I was wondering how I would do it:
1• I think that maybe could be possible getting the maximum DailyVolume of a contract list/array, that could be filled with a loop or using the Market Analyzer list… I’m not sure if this is possible or not.
2• The other way that I thought was using the expiration day of every contract as a trigger to change to the next contract, just retrieving the “Contract month” and the “Rollover date” in the Instrument Manager/Editor.
I programmed something “similar” with vba in the past in order to generate a continuous contract with the market replay data, comparing the same instrument “.ntm/.nt2” files in a day/folder and “getting rid” of the lighter ones, finally renaming the months. Example: “02-12”… to “##-##”.
I did it with an expiration date list either but that was a bit tricky and slower than the first option.
The point of this is that I think this project could not be so difficult because I’m not a programmer and I managed to create a Marker Replay Data manager based on the same principles.
Once I know which contract is the one with the higher DailyVolume, I would like to change to it automatically while the strategy is running. Ex: “CL 02-12” to “CL 03-12”. But again I don’t know how to do it
So far I change contracts manually using the Market Analyzer with a DailyVolume column that it’s linked to a chart which is running a strategy, but this method it’s a bit limited, especially if I have several strategies running at the same time.
Thank you very much!
Jairo.
PS: Sorry for the grammar I do my best!
|