reference 'external' indicator buffer (create indicator alert)

 

Let's say you had a custom indicator and you wanted to reference the value of it in another indicator.  How would you go about doing this?

I tried it this way:

if ( indicator_buffer[last_bar] < number )

{

PlaySound( "alert.wav" );

}

in the indicator itself, which works, but it tends to lock up when switching time frame.  Which is part of the reason why I want it in a separate indicator.

I've skimmed this article: https://www.mql5.com/en/articles/1372 but it doesn't seem to be what I'm looking for.  Or it is possible that I'm just not doing it right.

Alert and Comment for External Indicators (Part Two)
Alert and Comment for External Indicators (Part Two)
  • www.mql5.com
Here, we will see how we can get values from indicator buffers and use them to inform the user of certain indicator events. Whereas there is a group of operators that are used to get the required characteristics when reading the parameters of graphical plotting, parameters of indicator buffers can only be set. Here, we cannot get, let's say...
 
antiseptic: reference the value of it in another indicator.  How would you go about doing this?


in the indicator itself, which works, but it tends to lock up when switching time frame.  Which is part of the reason why I want it in a separate indicator.

  1. Detailed explanation of iCustom - MQL4 and MetaTrader 4 - MQL4 programming forum

    1. Putting your broken code in another indicator fixes nothing.
    2. If it takes too long to compute, reduce Max bars on chart to something reasonable (like 1K.)
    3. Worse case update the indicator in segments.