I am strugling with the proper method to identify the Close of the Bar prior to the Open of the last bar.
I am developing under : CalculateOnBarClose = true; using Time Bar Charts
I would like to know that the open of the next bar is the last bar in the session and not take a position.
I am able to find the session end time and session length via:
private DateTime sessionBegin;
private DateTime sessionEnd;
Bars.Session.GetNextBeginEnd(BarsArray[0], 0, out sessionBegin, out sessionEnd);
int TimeSpan = ToTime(sessionEnd) - ToTime(sessionBegin);
I am able to determine the Chart timeframe via:
Bars.Period.Value
From there I am unable to calculate whether or not the:
Time[0] of the current bar is equal to sessionEnd time less the Bars.Period.Value.
Any and all help would be greatly appreciated.
Regards.
Larry

Comment