ICustom RSI divergence call up a buffer of an indicator - page 2

 

Of course, but I ran all my tests in the Beck tests.

The same problem was identified at the following link for an indicator that uses the same logic:

https://www.mql5.com/en/forum/13342/page4#comment_39827391

Indicators: MACD Divergence
Indicators: MACD Divergence
  • 2021.01.16
  • www.mql5.com
MACD Divergence: Author: Alain Verleyen...
 

I see what the problem is: the arrow buffer is written when you are well passed the divergence... It means the indicator is lagging and you never get divergence signal in first bar.

You have to read the buffer value when two bars passed.

      ProcessBullish(rates_total,high,low,time,i+2);
      ProcessBearish(rates_total,high,low,time,i+2);
CopyBuffer(handle, 0, shift=2, 1, myBuff);
//myBuff[0] keeps the value
Reason: