Is there a truly reliable/robust way to determine the BarStartTime for any kind of time-based bar (intraday, daily, or weekly) in NinjaScript?
Here's what I've learned the hard way so far:
1. One can't just subtract the Bar Period (say 15 minutes for a 15-minute bar) from the BarEndTime of the bar, because for a 15-minute bar that opens 5 minutes to the session close, the BarEndTime of the bar in NinjaScript is actually the session close, which is only 5 minutes from the 15-minute bar's BarStartTime in that case.
2. One can't just assume that the BarStartTime of the bar is the Bar End Time of the prior bar for a few reasons, one of which being for 1-minute bars in a thinly traded market, a minute may go by without a trade, so the end time of the last price bar would be 2 minutes from BarEndTime of the current 1-minute PriceBar.
I can't find a property or a method exposed in the NinjaScript API to get the BarStartTime for a bar. What am I missing?
Thank you very much in advance,
EquityTrader

Comment