Download MetaTrader 5

a reset function for an EA if specific criteria has been met (?)

To add comments, please log in or register
Nauris Mucenieks
839
Nauris Mucenieks  

im thinking about adding a "reset" button to my EA (mql4).


question is if it would function like that?


steps and criteria are pretty basic - so i would really appreciate of the "local guru's" could answer my question.


step one - record the balance before the EA is started up.

step two - setting the milestone - lets say, once the equity has grown X percent in difference to the balance - blam, magic - we return to step one.


now, i know theres a lot of tricky magic in mql language, and i presume something like that is possible.

thanks in advance.



also, if any one has suggestions - feel free to PM me.


cheers. 

Drazen Penic
2700
Drazen Penic  

No need for magic.

One possible solution (out of many): 

  • declare variable to keep current step
  • add test that will execute code depending on the current step (one or two)
  • add code that will check if step should be changed 

Nauris Mucenieks
839
Nauris Mucenieks  
drazen64:

No need for magic.

One possible solution (out of many): 

  • declare variable to keep current step
  • add test that will execute code depending on the current step (one or two)
  • add code that will check if step should be changed 

so, it is possible. awesome.

sadly, i dont code, so this seems pretty much chinese to me.

To add comments, please log in or register