How to terminate an EA after it's done its job? - page 2

lumanauw
21
lumanauw  
kennyhubbard wrote >>

Hi,

As far as I know, new ticks are ignored if the start function has not completed it execution, so I am not sure this is your problem.


That's really good. Where can I read about this?

gordon
2327
gordon  
lumanauw:

That's really good. Where can I read about this?

Read about the special function start() -> https://book.mql4.com/programm/special. Quoting:

In Expert Advisors the special function start() is called (and executed) immediately after a new tick comes. If a new tick has come during the execution of the special function start(), this tick will be ignored, i.e. the special function start() will not be called for execution when such a tick comes.
So something else must be causing your CPU problems.


p.s. Why are u resurrecting threads that have nothing to do with your question? Start a new thread next time...
tradegiant360
6
tradegiant360  

Slava:
Divide by zero in the EA stops your EA permanently. See https://docs.mql4.com/runtime/errors

hello sir,

in my case i want to turn off or terminate ea from continuing trading after reaching certain point.

if(AccontEquity() < (amountdeposited -( amountdeposite x 0.2)))

{

turn off ea

}

else  if(AccontEquity() > (amountdeposited -( amountdeposite x 0.2)))

{

continue trading

}


please help fix this. thanks in advance.

Keith Watford
Moderator
30306
Keith Watford  
tradegiant360:

Do not double post!

I have deleted your other topic.

Please edit your post and use the code button (Alt+S) when pasting code.

EDIT your original post, please do not just post the code correctly in a new post.


Use ExpertRemove().