Thanks for clarifying.
I think you are running into a race condition. The value being displayed is the value calculated from OnRender (try changing the date used and the OnBarUpdate will reflect the same). This is processing asynchronously as OnBarUpdate is also processing.
Our advice would be not to call CalculateTradingDay() in OnRender and calculate this in a data driven method like OnBarUpdate. (You can still use the begin / end time, however, don't trigger the calculation unless you are in a data driven method)
Regarding the issue with the historical bars being marked as real-time, until this is corrected in a future version of NinjaTrader, IsSuspendedWhileInactive set as false would prevent the incorrect behavior.
Comment