NinjaTrader previously used a Historical bool property to notify when an indicator or strategy bar was being processed historically or real-time. The NinjaTrader 8 OnStateChange() method has now introduced a concept of State.Historical or State.Realtime which will allow you to take action depending on the desired state:
protected override void OnBarUpdate()
{
// only process on real-time data
if (State == State.Historical)
return;
else if (State >= State.Realtime)
// rest of logic
}
Shouldn't this say ... in the OnBarUpdate() method...?
BTW, awesome new capability - this is something I spent months finding work arounds for.
Comment