I'm developing a class that shows rollovers on charts and do some other stuff. RolloverCollection has rollover dates but not times, (time in those dates are 12:00AM). By NT logic rollover "occurs" at first bar of trading session and NT uses prices from new contract. So how do I get this first bar? And have some logic when this bar occurs.
Well, I can loop though all bars before processing bars OnBarUpdate (CurrentBar ==0), find when Bars.IsFirstBarOfSessionByIndex() is true and find nearest bar dates to my rollover dates. But it just sooo inefficient. I got 75 instruments, each has at least 80 rollovers, on 5 min chart for last 20 years... That's a crime against CPU time.
Maybe there is better way? Any advice would be appreciated.
Comment