Reply To: PPO

Optuma Forums Optuma Scripting PPO Reply To: PPO

  • Topics: 28
  • Replies: 1,442
  • Posts: 1,470

Hi Karen,

I’m assuming—by looking at your script—that negative divergence is when the PPO indicator is going down and the price is going up. My comments below are based on that assumption. If you are looking for something else, please let me know where I can read the theory behind it. I agree with Trevor that the best way to approach any issue is to output each line and check that it is what you expect.

Comment 1 – Pivot should be backwards-looking only.

We pass through the data in order and if we consider both directions then we are adding in a forward-looking bias.

Comment 2 – ValueWhen() holds the value until the condition is next true. Here is the value of V1. In this image the lines are your event of

and the shaded area is

Note how the level stays until the next time P1 <> 0.


This means that the following line is actually looking for a decrease in the value of the PPO when the signals happened

I don’t think that is what you are looking for. The actual solution to this is not trivial and is beyond what I can do here right now. If you want us to solve this, we’d need you to organise a Scripting consult at

An alternative is to use the Vergence function. (See KB

All the best


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.