**The Percentage Price Oscillator (PPO)**, widely recognized as PPO, is a momentum indicator that showcases the percentage difference in price between two distinct moving averages. Essentially, it’s the subtraction of the shorter moving average from the longer one, divided by the longer moving average, expressed in percentage.

Remarkably akin to MACD (Moving Average Convergence Divergence), PPO’s key distinction lies in its presentation of the difference between the shorter and longer moving averages in percentage terms, while MACD presents this difference in plain dollar values. This distinct trait of PPO simplifies comparisons across various assets.

Typically, PPO employs 12-period and 26-period exponential moving averages for its calculations, although traders often tailor these periods to suit their individual trading strategies.

Just like MACD, PPO too includes a *signal line*, which is essentially the EMA of the PPO. This signal line tends to move more sluggishly compared to the PPO. Additionally, the PPO’s divergence from its signal line is known as the *PPO histogram*.

A positive PPO emerges when the shorter period moving average surpasses the longer period one, signaling strong upward momentum when its value is high. Conversely, a negative PPO appears when the longer moving average exceeds the shorter one, indicating significant downward momentum as its value dips lower.

### Optimal Timeframes

This indicator is versatile, functioning effectively across various timeframes. However, analyzing multiple timeframes can provide stronger confirmation of the signals.

**Explore Further: Acceleration Bands AFL Code**

### Visual Representation

Displayed below is a screenshot of the Percentage Price Oscillator plotted on an Amibroker chart. Notice the green line indicating the PPO and the red line signifying the signal, each plotted on their respective scales.

### PPO AFL Code

` ````
```//------------------------------------------------------
//
// Formula Name: Percentage Price Oscillator
// Website: https://zerobrokerageclub.com/
//------------------------------------------------------
_SECTION_BEGIN("Percentage Price Oscillator");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} â€“ {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( Close, "Price", colorWhite, styleCandle );
PPOShort = Param("PPO Short Period", 12, 1, 150, 1);
PPOLong = Param("PPO Long Period", 26, 1, 150, 1);
PPOsignal = Param("PPOsignal", 9, 1, 150, 1);
PPO = (EMA(C, PPOShort ) - EMA(C, PPOLong ))/ EMA(C, PPOLong ) * 100;
PPOS = (EMA(ppo, PPOsignal ));
Plot( PPO , "ppo", colorGreen, styleLine| styleThick| styleOwnScale );
Plot ( PPOS ,"PPO Signal", colorOrange, styleLine| styleThick | styleOwnScale );
_SECTION_END();

### Understanding the AFL Code

Upon initializing the chart title and candlestick chart, we compute the PPO and its signal line using the following formulas:

**PPO** = ((12-period EMA – 26-period EMA) / 26-period EMA) × 100

**Signal Line** = 9-period EMA of PPO

Definitions:

**EMA** = Exponential Moving Average

**Range** = (High – Low) / ((High + Low) / 2)

Subsequently, these lines are illustrated on a candlestick chart using Amibroker’s standard “plot” function.

Eager to master AFL coding and create your own profitable trading systems? Dive into our AFL code section.

### Guidelines for Long and Short Positions

The rules for initiating long and short positions mirror those of MACD.

- Initiate a long position when the signal line crosses over the PPO line.
- Go short when the signal line crosses under the PPO line.
- Presence of PPO above zero implies an uptrend, whereas below zero indicates a downtrend.
- PPO can also aid in identifying technical divergences between the asset’s price and the indicator itself. For instance, a higher high in price coupled with a lower high in PPO may suggest a weakening bullish phase. Conversely, a lower low in price along with a higher low in PPO could hint at the end of a bearish phase.

## One Comment