automaticly stop the EA if the equity is less than a predeterminded value.
Hi,
Could anyone tell me, is there a way to automatically stop the EA if the equity is less than a predetermined value. Is there a bulit-in function in MT5
check ExpertRemove() function.
- www.mql5.com
With this approach, the ExpertAttach() function would be required to return the expert to the chart when the equity again become greater than the value from the settings😄
Hi,
Could anyone tell me, is there a way to automatically stop the EA if the equity is less than a predetermined value. Is there a bulit-in function in MT5
- If you have the source code of the EA that you want to stop, then you need to make changes to it. Namely, check equity before sending trade requests.
- If you do not have the source code, then it is much more difficult, but still implementable. But anyway, this option is worse than changes to the source code of the adviser
void OnTick() { double MaxDrawDown = 5 ; if(((1-(AccountEquity()/AccountBalance()))*100)>MaxDrawDown) { //here you can put any order like delete PendingOrder or CloseBUY or CloseSELL } }
Hi,
Could anyone tell me, is there a way to automatically stop the EA if the equity is less than a predetermined value. Is there a bulit-in function in MT5