![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Feb 2009
Location: Redwood Shores, CA
Posts: 174
Thanks: 0
Thanked 0 times in 0 posts
|
I'm using following chart:
* Intraday chart (e.g., Renko) * Instrument of EMD 12-10 with default session template (which is CME US Futures RTH I believe) * Merge policy is set for MergeBackAdjusted I'm trying to determine the boolean logic to detect when we've rolled over to new contract within a continuous contract intraday chart that auto-merges many contracts per the merge policy setting. I want to detect this historically via the indicator if possible so I can see the precise first bar in my chart for a newly rolled over contract (e.g., in March, June, Sept, Dec for index type futures). I've tried a couple of ideas - like Bars.TotalTicks or Bars.TickCount for the variable to check against but still no luck, for example: Code:
if (Bars.TotalTicks > 1) //<---- Not sure of if expression here to detect rolled over contract
//Found first bar of new contract that we've rolled over/merged into on this chart
Print(String.Format("Rolled Over Contract Detected with {0} on TickCount {1}, Bar {2}, [{3}]",
Instrument.FullName, Bars.TickCount, CurrentBar, Time[0]));
![]() JD |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
JD, unfortunately you could not programmatically access the rollover dates defined. You can perhaps add the dates yourself to the script for example as StringSeries and then check off against this.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Determine if using 64bit | bobcat70 | Miscellaneous Support | 1 | 09-14-2010 11:33 PM |
| How can you create a continuous contract for long term futures contract backtesting | Thorserb2 | Market Analyzer | 11 | 03-16-2010 11:19 AM |
| How to determine whether an instrument is dealable or not | Buthus | Strategy Development | 7 | 11-06-2009 06:30 AM |
| Merging previous contract to create Continous contract? | cw30000 | Charting | 2 | 10-28-2009 10:01 AM |
| ninja automatically rolled es to dec | chan123 | Miscellaneous Support | 4 | 09-10-2007 11:15 AM |