Detecting divergence in MQ5 help.

 

Indicator used - https://www.mql5.com/en/code/22602

Been searching for about 7 hours, but cant seem to get anything to work. I have tried working with icustom and looking at the buffer but kept getting the empty value,

in which I tried to detect if it value != empty value but it didn't work either. Saw on ForexFactory that people were looking for objects drawn but the code posted didn't work for me. Any help would be great.

Kind regards,

Lachlan

RSI_Divergence
RSI_Divergence
  • www.mql5.com
RSI Divergence indicator
 
Lachlan James:

Indicator used - https://www.mql5.com/en/code/22602

Been searching for about 7 hours, but cant seem to get anything to work. I have tried working with icustom and looking at the buffer but kept getting the empty value,

in which I tried to detect if it value != empty value but it didn't work either. Saw on ForexFactory that people were looking for objects drawn but the code posted didn't work for me. Any help would be great.

Kind regards,

Lachlan

The code seems to draw objects on chart. You could try using OnChartEvent to detect object creation of specific type. 

Documentation on MQL5: Event Handling / OnChartEvent
Documentation on MQL5: Event Handling / OnChartEvent
  • www.mql5.com
OnChartEvent - Event Handling - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5