Divergence

Divergence occurs when prices go up or stay constant and the indicator value goes down, or when prices go down or stay constant and the indicator value goes up. It is calculated in the following manner:


Let’s assume that we have a divergence value of 10 and we are going to test for divergence up. Investigator will go back 9 bars from the current bar (we go back 9 bars instead of 10 because we include the current bar in our testing) and get the current low price and the current indicator value for the bar. Investigator then checks each bar, up to and including the current bar, to see which bar has the lowest low price and which bar has the lowest indicator value. If the bar that has the lowest price occurs before the bar that has the lowest indicator value, then divergence occurs.