Reply To: How to calculate positive and negative divergences

Optuma Forums Optuma Scripting How to calculate positive and negative divergences Reply To: How to calculate positive and negative divergences


  • Topics: 2
  • Replies: 3
  • Posts: 5

I’ve been trying to apply this technique to show divergence between price and the non lag inverse fisher transform of RSX.

I’ve altered the code as follows:

//Negative NLRSX divergence
//calculate 10 pivot NLRSX high
P1 = PIVOT(NL1, MIN=10, TYPE=High);
//get value of the NLRSX peak
V1 = VALUEWHEN(NL1, P1 <> 0);
//Is NLRSX high < previous>?
Sig1 = V1 < V1[1];
//get stock value at NLRSX peak
V2 = VALUEWHEN(Close(), P1 <> 0);
//Is stock price higher than at previous NLRSX peak?
Sig2 = V2 > V2[1];
//Show when both conditions are true
Sig1 and Sig2

On the attached chart, I’m getting a result for divergences between A and B and also C and D, but not that between B and C.

However when I alter the pivot line to a value of 6, divergence A to B, and B to C is shown, but not C to D.

What do I need to do in order to have divergences A to B, B to C and C to D show up?





Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.