The percentage price oscillator (PPO) is a technical momentum indicator that shows the relationship between two moving averages. To calculate the PPO, subtract the 26-period exponential moving average (EMA) from the 12-period EMA, and then divide this difference by the 26-period EMA. The result is then multiplied by 100. The indicator tells the trader where the short-term average is relative to the longer-term average.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
//Percentage Price Oscillator - PPO // //The percentage price oscillator (PPO) is a technical momentum indicator that shows the relationship between two moving averages. To calculate the PPO, subtract the 26-period exponential moving average (EMA) from the 12-period EMA, and then divide this difference by the 26-period EMA. The result is then multiplied by 100. The indicator tells the trader where the short-term average is relative to the longer-term average. // // Here is the PPO calculation: ((12-day EMA - 26-day EMA) / 26-day EMA) x 100 // // https://www.investopedia.com/terms/p/ppo.asp // http://www.traderpedia.it/wiki/index.php/Price_oscillator_(DOA) // SlowP = 26 //Periods of Slow Average FastP = 12 //Periods of Fast Average AvgType = 1 //Average Type (0=sma, 1=ema, 2=wma,...) Percentage = 1 //1=calculate Percentage 0=no percentage // DEFPARAM CalculateOnLastBars = 1000 SlowP = max(1,min(999,SlowP)) //1 - 999 FastP = max(1,min(999,FastP)) //1 - 999 AvgType = max(0,min(6,AvgType)) //0 - 6 Percentage = max(0,min(1,Percentage)) //1=Percentage 0=NO Percentage SlowAvg = Average[SlowP,AvgType](close) FastAvg = Average[FastP,AvgType](close) Difference = FastAvg - SlowAvg IF Percentage THEN Difference = (Difference / SlowAvg) * 100 ENDIF RETURN Difference,0 |

I am also attaching the MACD type version (it is very similar):

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
//Percentage Price Oscillator - PPO (with Histogram) // //The percentage price oscillator (PPO) is a technical momentum indicator that shows the relationship between two moving averages. To calculate the PPO, subtract the 26-period exponential moving average (EMA) from the 12-period EMA, and then divide this difference by the 26-period EMA. The result is then multiplied by 100. The indicator tells the trader where the short-term average is relative to the longer-term average. // // Here is the PPO calculation: ((12-day EMA - 26-day EMA) / 26-day EMA) x 100 // // https://www.investopedia.com/terms/p/ppo.asp // http://www.traderpedia.it/wiki/index.php/Price_oscillator_(DOA) // https://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:price_oscillators_ppo // http://www.forexwiki.it/PPO // SlowP = 26 //Periods of Slow Average FastP = 12 //Periods of Fast Average AvgType = 1 //Average Type (0=sma, 1=ema, 2=wma,...) Percentage = 1 //1=calculate Percentage 0=no percentage SignalP = 9 //Periods of Signal Average // DEFPARAM CalculateOnLastBars = 1000 SlowP = max(1,min(999,SlowP)) //1 - 999 FastP = max(1,min(999,FastP)) //1 - 999 AvgType = max(0,min(6,AvgType)) //0 - 6 Percentage = max(0,min(1,Percentage)) //1=Percentage 0=NO Percentage SignalP = max(1,min(999,FastP)) //1 - 999 SlowAvg = Average[SlowP,AvgType](close) FastAvg = Average[FastP,AvgType](close) Ppo = FastAvg - SlowAvg IF Percentage THEN Ppo = (Ppo / SlowAvg) * 100 ENDIF SignalLine = Average[SignalP,AvgType](Ppo) Histo = Ppo - SignalLine RETURN Ppo AS "Ppo",SignalLine AS "Signal",Histo AS "Histogram",0 |

### Share this

**Risk disclosure:**

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

**ProRealTime ITF files and other attachments :**

**Filename :**download the ITF files

*How to import ITF files into ProRealTime platform?*

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

juanj• 285 days ago #Haven’t been on this forum for ages! Just logged in to see what is happening and since this caught my eye I decided to quickly write it into a strategy 🙂

For some reason, the Add PRT Code doesn’t work so here is the unformatted code:

//EURUSD 1Hr

Defparam cumulateorders = False

possize = 1

SlowP = 26 //Periods of Slow Average

FastP = 12 //Periods of Fast Average

AvgType = 1 //Average Type (0=sma, 1=ema, 2=wma,…)

Percentage = 1 //1=calculate Percentage 0=no percentage

SignalP = 9 //Periods of Signal Average

//

SlowP = max(1,min(999,SlowP)) //1 – 999

FastP = max(1,min(999,FastP)) //1 – 999

AvgType = max(0,min(6,AvgType)) //0 – 6

Percentage = max(0,min(1,Percentage)) //1=Percentage 0=NO Percentage

SignalP = max(1,min(999,FastP)) //1 – 999

SlowAvg = Average[SlowP,AvgType](close)

FastAvg = Average[FastP,AvgType](close)

ppo = FastAvg – SlowAvg

IF Percentage THEN

ppo = (ppo / SlowAvg) * 100

ENDIF

SignalLine = Average[SignalP,AvgType](ppo)

Histo = Ppo – SignalLine

If longonmarket and histo < 0 or ppo 0 or ppo > SignalLine Then

Exitshort at market

EndIf

If ppo > 0 and signalLine SignalLine Then

If shortonmarket Then

Exitshort at market

EndIf

Buy possize contract at market

ElsIf ppo 0 and ppo < SignalLine Then

If longonmarket Then

Sell at market

EndIf

Sellshort possize contract at market

EndIf

robertogozzi• 285 days ago #Welcome back Juanji, why don’t you post your strategy in the ProOrder support, it’s a better place to talk about strategies and improve them.

Thank you.