"When testing in an EA, we can handle custom events using the OnChartEvent() function, but in the indicators, this function can not be called in the tester. Even if the indicator has the OnChartEvent() event handler and this indicator is used in the tested EA, the indicator itself will not receive any custom events."
Source: https://www.mql5.com/en/docs/runtime/testing#events
Any other way to send information from the EA to the indicator?
You can use Global Variables of the Client Terminal.
May I ask why you want to communicate from EA to indicator ?
This way I can only send data to the indicator during the initialization.
You can use Global Variables of the Client Terminal.
May I ask why you want to communicate from EA to indicator ?
That's not instant, but it's a good option, thanks.
It's not a real indicator, I want to use it to display some information calculated by the Expert.
"When testing in an EA, we can handle custom events using the OnChartEvent() function," is this true? I can NOT get a OnChartEvent to work in the tester at all. It will work on a live chart but not in the tester. Is there some secret setting that makes it work in tester? Or is this completely false?
i'm facing the same problem, any workaround
and work around Chart Event For MT4 Backtester - Strategy Tester - MQL4 programming forum #7 2016.04.03
and How to use OnChartEvent buttons to work in Tester - MQL4 programming forum - Page 2 #11 2019.04.28
i'm facing the same problem, any workaround
Simply emulate it.
Catch the OnTick() (MT4) or OnTimer() (MT5), use the Windows functions the check the mouse position and the window-size, translate into such variables which OnChartEvent() needs and do it like that. Not such a big deal, at least not in MT4. In MT5 you have do so some loops to the whole windows-structure to find the window-handle of the chart.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
"When testing in an EA, we can handle custom events using the OnChartEvent() function, but in the indicators, this function can not be called in the tester. Even if the indicator has the OnChartEvent() event handler and this indicator is used in the tested EA, the indicator itself will not receive any custom events."
Source: https://www.mql5.com/en/docs/runtime/testing#events
Any other way to send information from the EA to the indicator?