Download MetaTrader 5

Changing timeframe restarts EA

To add comments, please log in or register
ParaMoo
10
ParaMoo  

Hi,

I have been currently running my EA on a demo account "EURUSD". However, everytime i move from an hour chart to 15 mins or any other. The EA restarts and places additional orders for conditions that have alreay been met in the previous time chart.

How can I stop this problem ?


Regards,


Paramoo

whroeder1
15934
whroeder1  

ParaMoo:

However, everytime i move from an hour chart to 15 mins or any other. The EA restarts

and places additional orders for conditions that have alreay been met in the previous time chart. How can I stop this problem ?

  1. Always along with all the other reasons.
  2. Check for existing orders. EA's must be coded to recover. If the power fails, OS crashes, terminal or chart is accidentally closed, on the next tick, any static/global ticket variables will have been lost. You will have an open order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage (GV+flush or files) of ticket numbers required.
To add comments, please log in or register