I'm developing a custom BarsType built from tick data. It needs to always start processing tick data from the session start time of the bars.FromDate date.
The issue I'm encountering is that if there is cached bar data for the bars.FromDate date, all that tick data is skipped over and not processed.
e.g. The following code produces the following output when there is cached bar data.
protected override void OnDataPoint(Bars bars, double open, double high, double low, double close, DateTime time, long volume, bool isBar, double bid, double ask) {[INDENT]if(runOnce) {[/INDENT][INDENT=2]Print(dir+".Count = "+bars.Count+" \t .FromDate = "+bars.FromDate+" \t\t time = "+time); // " \t time.Date = "+time.Date+ runOnce = false;[/INDENT][INDENT]}[/INDENT]
.Count = 39 .FromDate = 2/22/2021 12:00:00 AM time = 2/25/2021 1:04:32 AM
The barstype I'm creating needs to start processing tick data from 2/22/2021 4:00:00 PM, which is when the session begins. But, NT starts processing tick data at 2/25/2021 1:04:32 AM. How can this be done?
Thanks.
Comment