pause a script until some key is hit

 

Hello!

I wrote a script that searches through a chart for some pattern. After a script found that let say (High-Low) > 50 pips it stops, scrolls a chart to that point and zooms in in a larger scale (15M instead of 1D). Now, I would like a script to pause until I do some extra work on the found place, then after it is done, I would like to tell the script to run further for the next occurrence to find and so on. 

Sleep(10000) would be fine if I could tell for sure how long it takes for the extra work to be done.

MessageBox probably would be okay, but it is open in modal mode, so I can not do anything to a chart manually.

So, what I need is a script to "listen" to me until I push some magic key in order for a script to continue.

Can that be done in MT5?

Thank you! 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Input/Output Constants / MessageBox
Documentation on MQL5: Standard Constants, Enumerations and Structures / Input/Output Constants / MessageBox
  • www.mql5.com
Standard Constants, Enumerations and Structures / Input/Output Constants / MessageBox - Documentation on MQL5
 
ns_k:

Hello!

I wrote a script that searches through a chart for some pattern. After a script found that let say (High-Low) > 50 pips it stops, scrolls a chart to that point and zooms in in a larger scale (15M instead of 1D). Now, I would like a script to pause until I do some extra work on the found place, then after it is done, I would like to tell the script to run further for the next occurrence to find and so on. 

Sleep(10000) would be fine if I could tell for sure how long it takes for the extra work to be done.

MessageBox probably would be okay, but it is open in modal mode, so I can not do anything to a chart manually.

So, what I need is a script to "listen" to me until I push some magic key in order for a script to continue.

Can that be done in MT5?

Thank you! 

Use OnChartEvent() with appropriate event handler.
 
angevoyageur:
Use OnChartEvent() with appropriate event handler.

I'll will try this. 

Thank you!