Code to Remove EA from one Chart

 
I have one EA that I would like put one routine when Equity < SomeDoubleValue not just desabilit the EA, but remove from the chart, like Pressing "F7"->Expert->Remove, but inside my EA code.
Tks guys,
Marcelo
 
marcelo0 :
I have one EA that I would like put one routine when Equity < SomeDoubleValue not just desabilit the EA, but remove from the chart, like Pressing "F7"->Expert->Remove, but inside my EA code.
Tks guys,
Marcelo

What's wrong with the deinit() function?

 
CrispinScruby :
marcelo0 :
I have one EA that I would like put one routine when Equity < SomeDoubleValue not just desabilit the EA, but remove from the chart, like Pressing "F7"->Expert->Remove, but inside my EA code.
Tks guys,
Marcelo

What's wrong with the deinit() function?

The deinit() function cannot be used to stop the EA, much less remove it from the chart.

The deinit() function is called when the EA is stopping and the contained block then has 2500 milliseconds to execute.

You can also call the deinit() function but after the contained block has executed, control will be returned to the calling function.