I noticed that when using Playback, when we move the time slider the chart is replayed from beginning of day to the selected time and during all that time the reported State is RealTime
Not sure if this is this way by design or an error, but if it is this way by design, how can I detect from the code that we are not RealTime but just relocating the time slider to the new selected time ?
PS : Easy to test ;
Edit the Strategy SampleMACrossOver
if (CrossAbove(smaFast, smaSlow, 1))
{
Print("OnBarUpdate State = " + State.ToString() );
EnterLong();
}
else if (CrossBelow(smaFast, smaSlow, 1))
{
Print("OnBarUpdate State = " + State.ToString() );
EnterShort();
}
When we enable the strategy we get all the previous trades printed as "OnBarUpdate State = Historical"
Now if we move the time slider to a new date and/or time we get all trades printed as "OnBarUpdate State = Realtime"
Thanks
Pablo
Comment