pause visual backtest at specific time of day or date/time stamp...

 

Can you include a way to pause/slowdown the backtester after it has reached a certain time or date/time?

MT4 tester does not currently have ability to pick HH:mm time of day to start backtest.  So you always have to start at the beginning of the day, even if what you need to obverse is near the end of the day..  It would be nice to run at full speed up to the point (time of day or date + time of day0 where then you could slow it down. 

Any ideas?


I saw some code on how to slow a backtest.  But nothing to jump / run at full speed to a specific time of test 

 
You can use DebugBreak in your code wrapped in a condition for specific datetime.
 
Stanislav Korotky:
You can use DebugBreak in your code wrapped in a condition for specific datetime.
In MT4 Strategy Tester ?
 
Alain Verleyen:
In MT4 Strategy Tester ?

Oh, sorry. Two my mistakes. First, correct link to MQL4's DebugBreak - is this. And second, it's indeed of no use in MT4 during visual testing, because MT4 does not support this mode (debugging on historical data).

As a workaround I'd suggest this code snippet using DLL imports:

#include <WinUser32.mqh>

void PauseTester()
{
  if(IsVisualMode())
  {
    keybd_event(19, 0, 0, 0);
    Sleep(20);
    keybd_event(19, 0, 2, 0);
  }
}

You can call it something like this:

static bool once = false;
if((lastBar > D'2018.07.01') && !once)
{
  PauseTester();
  once = true;
}

The idea is taken from the article.

Reason: