Very easy and simple awnser to a question I have for now days

 

well... if there any way to disable ea with a command on some donctition exemple:

any help would be much appreciated :)

if AccountEquity() >= x

   {

      TheCommandIseek();  ///Stop Ea or either turn live trading to off would do (I would first go for disabling ea) 

   }

 
liquidd:

well... if there any way to disable ea with a command on some donctition exemple:

any help would be much appreciated :)


TheCommandISeek() can be return(0);

start()

step 1: handle already open orders

step 2: if accountEquity()>=x ... return and do nothing more

step 3: check for open new orders and else ....

 
EADeveloper:


TheCommandISeek() can be return(0);

start()

step 1: handle already open orders

step 2: if accountEquity()>=x ... return and do nothing more

step 3: check for open new orders and else ....


I just want it to stop once it gives me a certain amount of profit I don't want it to re-start and keep going I just wanna re-start my ea every time I have this kind of profit so I can figure out if I wanna cash out a bit or leave it there
 

I think the only way to achieve this is to cause an fatal error in the EA, as there is no clean way to do this with a programming command.

Why can't you solve this with other way like a bool variable which you set and check ?

Regards, Klaus

 
liquidd:

I just want it to stop once it gives me a certain amount of profit I don't want it to re-start and keep going I just wanna re-start my ea every time I have this kind of profit so I can figure out if I wanna cash out a bit or leave it there


https://www.mql5.com/en/forum/122839

The search in the forum offer some times some help ;-)

Reason: