Pause / slow down visual mode speed

 

Greetings.

 Is there any way that I can pause or slow down the speed value while testing in visual mode? 

 I want to run it at  32 speed and pause or slow down when a condition is met, so i can see visually what's going on.

 
puiucristian:

Greetings.

 Is there any way that I can pause or slow down the speed value while testing in visual mode? 

 I want to run it at  32 speed and pause or slow down when a condition is met, so i can see visually what's going on.

i like to learn that too
 

There is no way to alter the playback speed other then to move the speed slider.

If there was i would have implemented it.

 

you can press "pause" in your code.

#import "user32.dll"

bool YourCondition=true;
if(YourCondition)
  {
  int hwnd = WindowHandle(Symbol(),Period());
  PostMessageA(hwnd, WM_KEYDOWN, 19, 0);//19=Pause
  PostMessageA(hwnd, WM_KEYUP, 19, 0);
  }
 
Atsushi Yamanaka:

you can press "pause" in your code.

you're my hero!

 I had to include this line too to make it work

 

#include <WinUser32.mqh>
 
puiucristian:

you're my hero!

 I had to include this line too to make it work

 

sorry, i forgot and thanx to cover.
 

Now I need to ask you to help.

On MT5 tester, how come this didn't work? 

#include <WinUser32.mqh> 
#import "user32.dll" 

bool mycondition=true;
if(mycondition && MQLInfoInteger(MQL_TESTER)==1)
            {
              int hwnd = (int)ChartGetInteger(ChartID(),CHART_WINDOW_HANDLE,0);
              PostMessageA(hwnd, WM_KEYDOWN, 32, 0);//32=Space
              PostMessageA(hwnd, WM_KEYUP, 32, 0);
              Print("hwnd= ",hwnd);
            }
 
I tried PostMessageW but still it doesn't work...
 
Atsushi Yamanaka:
I tried PostMessageW but still it doesn't work...

I'm not sure why your code doesn't work

 

I use this one to pause it

 

void pause()
{
   int hwnd = WindowHandle(Symbol(),Period());
   PostMessageA(hwnd, WM_KEYDOWN, 19, 0);
   PostMessageA(hwnd, WM_KEYUP, 19, 0);
}

 

something like

 

if(mycondition && MQLInfoInteger(MQL_TESTER)==1) pause();
 

>puiucristian

Thank you for trying to help.

But is it for MT5? 

Reason: