Download MetaTrader 5

pause a script until some key is hit

To add comments, please log in or register
Store your source codes in MQL5 Storage. It is secure!
NTFS
650
NTFS 2013.04.01 22:03 

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
Alain Verleyen
Moderator
30721
Alain Verleyen 2013.04.01 22:20  
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.
NTFS
650
NTFS 2013.04.02 11:40  
angevoyageur:
Use OnChartEvent() with appropriate event handler.

I'll will try this. 

Thank you! 

To add comments, please log in or register