I’m developing within OnBarUpdate(). I watch for each criterion to trigger, play the appropriate sound, then store the DateTime.Now in a DateTime array per that sound file. This way I can check how long it has been since the sound was played. No problem. Everything works as expected.
Now I begin to Replay a simulation in Replay Mode. This is nice because it’s tick by tick instead of candle by candle. If I speed up Replay Mode to 2x, 10x, 100x, etc, my sound playing is skewed because the last played DateTime is seconds ago when in reality of the ticks being saved was perhaps minutes ago. Of course, DateTime.Now is the ACTUAL time NOW, not the tick time when it really occurred.
So I begin working with Time[0] to retrieve the current time of the tick. But it seems to be the time of the Close[0] of the bar we’re in, and NOT the DateTime of the tick when it occurred.
What should I be using to capture the Tick’s time during Replay for Strategy analysis? I seem to be stuck with the current DateTime.Now, but I know that this isn’t accurate and is skewed during fast replays.
Brian1
Comment