Download MetaTrader 5

OnChartEvent in Strategy Tester

To add comments, please log in or register
Track all payments in your profile. It is easy!
PhantonTrader
21
PhantonTrader 2016.06.04 21:42 

"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?

Documentation on MQL5: MQL5 programs / Testing Trading Strategies
Documentation on MQL5: MQL5 programs / Testing Trading Strategies
  • www.mql5.com
MQL5 programs / Testing Trading Strategies - Reference on algorithmic/automated trading language for MetaTrader 5
Mohamed Hamdy
1015
Mohamed Hamdy 2016.06.05 09:15  
Use iCustom() to pass a parameter to the indicator and return the handle
Alain Verleyen
Moderator
30737
Alain Verleyen 2016.06.05 15:30  
PhantonTrader:

"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 ?

PhantonTrader
21
PhantonTrader 2016.06.08 18:07  
Mohamed Hamdy:
Use iCustom() to pass a parameter to the indicator and return the handle

This way I can only send data to the indicator during the initialization.

Alain Verleyen:

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.

James Hodges
3218
James Hodges 2016.10.17 01:24  
"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?
To add comments, please log in or register