Please change your topic subject to something meaningful.
I will not even read a topic just asking for "Help", and I am certainly not the only one.
You seem to already know the answer, but have not realised it yet.
In your OnDeinit event handler you are releasing the indicator handles. That is your answer.
When you wish to "stop" the indicator, release its handle, during the OnTick() event handling.
EDIT: To help clarify the answer, please explain how exactly you are "turning off" the EA without removing it from the chart.
You seem to already know the answer, but have not realised it yet.
In your OnDeinit event handler you are releasing the indicator handles. That is your answer.
When you wish to "stop" the indicator, release its handle.
only stops send events when ea remove from chart but if turn off auto trading it is not working ıcustom still send events
Then, during the processing of events (OnTick, OnChart, etc.), you should read the current state of the "Algo Trading", and when it is off, you release the indicator handle.
And when it is on again, you will need to reinitialise the indicator handle. The best way, is probably to create a class object for the indicator so that you can initialise and release it on demand via the object's methods.
Here is some sample code to get the state of when trading is allowed or not during various situations ...
bool bAccountTradeAllowed = AccountInfoInteger( ACCOUNT_TRADE_ALLOWED ), bAutomatedTradeAllowed = AccountInfoInteger( ACCOUNT_TRADE_EXPERT ), bTerminalTradeAllowed = TerminalInfoInteger( TERMINAL_TRADE_ALLOWED ), bProgramTradeAllowed = MQLInfoInteger( MQL_TRADE_ALLOWED ), bAllTradeAllowed = bAccountTradeAllowed && bAutomatedTradeAllowed && bTerminalTradeAllowed && bProgramTradeAllowed;
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
there is code of ea , it retrieves tick data with custom indicator
problem is when turn off ea with manually it continues retrives data from custom indicator
it is only stops when manually remove ea from chart . how do i get the custom indicator to stop when i disable ea
i tried IndicatorRelease() func but it doesnt work