script removed from MT5 every 9'29"

 

Hey

I installed MT5 on Google Cloud, and wrote a script that would send emails to me when certain conditions are met.

The problem is that everytime I loaded the script to one of the charts, it will run perfectly; then 9 minutes 29 seconds later, the script is automatically removed.

Is there anything I am missing?  or is it something the cloud does that kicks my script out?  if it is the latter, since I only need to run the script once per hour, how can I load the script, using a command line, or batch, so I can "task schedule" hourly?


Thank you in advance!!!

 
zhanglini:

Hey

I installed MT5 on Google Cloud, and wrote a script that would send emails to me when certain conditions are met.

The problem is that everytime I loaded the script to one of the charts, it will run perfectly; then 9 minutes 29 seconds later, the script is automatically removed.

Is there anything I am missing?  or is it something the cloud does that kicks my script out?  if it is the latter, since I only need to run the script once per hour, how can I load the script, using a command line, or batch, so I can "task schedule" hourly?


Thank you in advance!!!

In MQL5, scripts are supposed to run just once. Load-Execute-End-Unload. Do you have an infinite loop in your script?
 
Minions Labs:
In MQL5, scripts are supposed to run just once. Load-Execute-End-Unload. Do you have an infinite loop in your script?

Ha I see, so I need to create some infinite loop to make sure it stays there??

Thanks a lot!

 
zhanglini:

Ha I see, so I need to create some infinite loop to make sure it stays there??

Thanks a lot!

I would'nt say that this is the best method to deal with your problem, since in it's purest form, the goal of a script is being executed only once and have a theoretical short life.

You can do this using an Indicator instead of a Script...

;)

 

zhanglini:

so I can "task schedule" hourly?

You could use the OnTimer() event of an EA or Indicator.

Minions Labs:

You can do this using an Indicator instead of a Script...

I agree.

 
Anthony Garot:

You could use the OnTimer() event of an EA or Indicator.

I agree.

thank you both