After pause resume- strategy tester

 

I am unable to pause, resume while doing manual back testing


Could any one please help 

 
Sivaramakrishnan ThavasiI am unable to pause, resume while doing manual back testing. Could any one please help.

If by "manual backtesting" you mean visual mode, then yes, the Pause button should fully stop the simulation, and when you press Play, it resumes exactly where it left off.

If something is not working after resuming (like orders not opening or logic skipping), it could be related to how your EA handles timing or internal states.

The EA may have time-dependent logic (Sleep, TimeCurrent, EventSetTimer, etc.) that is affected by the pause.

 
Miguel Angel Vico Alba #:

If by "manual backtesting" you mean visual mode, then yes, the Pause button should fully stop the simulation, and when you press Play, it resumes exactly where it left off.

If something is not working after resuming (like orders not opening or logic skipping), it could be related to how your EA handles timing or internal states.

The EA may have time-dependent logic (Sleep, TimeCurrent, EventSetTimer, etc.) that is affected by the pause.

Thank you for your kind reply 

I used function GetForegroundWindow() to pause the simulation in Mt4 back testing .
But it is completely stopped the simulation 
I need to start from beginning

I don't know how to resume where i left 
please help with me suitable functions, if possible coding


 
Simulator must be paused if the new order opens 

Resume Button was created 

By clicking Resume Button Resume Button simulation must be Resumed from pause
 
Sivaramakrishnan Thavasi #I used function GetForegroundWindow() to pause the simulation in Mt4 back testing .

GetForegroundWindow() can be run on the visual tester, but it does not allow you to pause or resume the simulation in a real way.

Just to clarify, the Strategy Tester is not designed to be externally controlled, for example to pause or resume programmatically.

However, you can build interactive logic within the EA itself during visual mode, like buttons, manual trade simulation or chart interaction, but all of that runs entirely inside the tester's environment.

So yes, manual logic is possible, but the tester's core execution such as pause, resume or speed control cannot be manipulated from the EA or from outside.

 
I used below code it is used to pause but unable to resume 

#include <WinUser32.mqh>
#import "user32.dll"
  int GetForegroundWindow();
#import

void doPauseTest(){
   int hmain;
   if (IsTesting() && IsVisualMode()){
      hmain = GetForegroundWindow();
      PostMessageA(hmain, WM_COMMAND, 0x57a, 0);
   }
}
 
When posting code, use the CODE button (Alt+S)! 
 
#include <WinUser32.mqh>
#import "user32.dll"
  int GetForegroundWindow();
#import

void doPauseTest(){
   int hmain;
   if (IsTesting() && IsVisualMode()){
      hmain = GetForegroundWindow();
      PostMessageA(hmain, WM_COMMAND, 0x57a, 0);
   }
}