OnChartEvent in nested Indicators problem

 

Hello!

Can it be true, that only the "outmost" indicator can receive OnChartEvents?


What I mean by that is:

To prepare for a Multi-Currency, Multi-Strategy project I started recently, I implemented something like the iSpy from https://www.mql5.com/en/articles/234

The main idea: it should be possible to, let's say, view Indicator1 of EURUSD on a TRYJPY chart.

But since TRYJPY trade very rarely, you attach a simple IndicatorSpy to EURUSD (from within Indicator1), which just creates a CustomChartEvent on each call of OnCalculate. And Indicator1 reacts to OnChartEvent rather than to OnCalculate.


So far so good.

But if I want to view Indicator2, which uses Indicator1 as price-feed, the whole system stalls. It seems that only Indicator2 receives OnChartEvent anymore, but that means Indicator1 does not update. And so Indicator2 does not work.


Can that be the case?

Or is it, that each ChartEvent can only be "received" once, and this starts "on the outside", and I would have to manually start any inner processes?

If so: any idea, how I can manually force my Indicator1 to run.




Hope I made my point halfway clear.

Grateful for any advice you can offer!

Clock

The Implementation of a Multi-currency Mode in MetaTrader 5
The Implementation of a Multi-currency Mode in MetaTrader 5
  • 2011.02.18
  • Konstantin Gruzdev
  • www.mql5.com
For a long time multi-currency analysis and multi-currency trading has been of interest to people. The opportunity to implement a full fledged multi-currency regime became possible only with the public release of MetaTrader 5 and the MQL5 programming language. In this article we propose a way to analyze and process all incoming ticks for several symbols. As an illustration, let's consider a multi-currency RSI indicator of the USDx dollar index.