# Price Percent Oscillator & Histogram

The Percentage Price Oscillator (PPO) is found by subtracting a long moving average from a shorter moving average, then dividing the result by the longer moving average. It is very similar to MACD which plots the difference between the short and long averages. PPO divides the difference by the longer average which calculates the value as a percentage of the longer average.

PPO = (12 day MA - 26 Day MA) / 26 Day MA

A moving average of this plot is then added as a signal line. The histogram is simply the difference between the PPO line and the signal line.

Of Price | PPO |
`100 * (tAVGCs.z / tAVGCl.z - 1)` |
`t` =AverageType,`s` =Short, `l` =Long, `x` =Trigger, `z` =Offset |

Trigger |
`100 * tAVG(tAVGCs.z / tAVGCl.z - 1), x)` |
||

Histogram |
`100 * (tAVGCs.z / tAVGCl.z - tAVG(tAVGCs.z / tAVGCl.z, x))` |
||

Generalized | PPO |
`100 * (tAVG(w, s) / tAVG(w, l) - 1)` |
`w` =Numeric, `t` =AverageType, `s` =Short, `l` =Long, `x` =Trigger |

Trigger |
`100 * tAVG(tAVG(w, s) / tAVG(w, l) - 1), x)` |
||

Signal |
`100 * (tAVG(w, s) / tAVG(w, l) - tAVG(tAVG(w, s) / tAVG(w, l), x))` |

Where `t`

is the Average Type. Leave blank for Simple, X for Exponential, F for Front Weighted, or H for Hull.

Where `s`

is the short period which must be an integer.

Whele `l`

is the long period which must be an integer.

Where `x`

is the trigger period which must be an integer.

Where `z`

is the offset. An offset of 1 returns the value for the previous bar instead of the current bar.

### Examples

An exponential PPO 12,26 can be written as follows.

`100 * (XAVGC12 / XAVGC26 - 1)`

A 9 period exponential trigger of the exponential PPO 12,26 can be written as follows.

`100 * XAVG(XAVGC12 / XAVGC26 - 1), 9)`

The exponential PPO Histogram 12,26,9 is the difference between the raw PPO and its moving average trigger.

`100 * (XAVGC12 / XAVGC26 - XAVG(XAVGC12 / XAVGC26, 9))`

Read more about Price Percent Oscillator (PPO) at Investopedia