PPO (Price Percent Oscillator) for ThinkorSwim

BenTen

Administrative
Staff
VIP
PPO is similar to MACD. The oscillator is displayed as a percentage so is consistent between all equities.

This script for ToS was created by Mobius.



thinkScript Code

Code:
# PPO
# Mobius
# V01.03.2014

declare lower;

input c = close;
input AvgType = AverageType.Simple;
input nFast = 8;
input nSlow = 13;
input nSmooth = 5;

plot PPO = ((MovingAverage(AverageType = AvgType, c, nFast) -
             MovingAverage(AverageType = AvgType, c, nSlow)) /
             MovingAverage(AverageType = AvgType, c, nSlow));
PPO.SetPaintingStrategy(PaintingStrategy.Histogram);
PPO.AssignValueColor(if PPO > 0
                     then color.green
                     else color.red);

plot smooth = MovingAverage(AverageType = AvgType, PPO, nSmooth);
smooth.SetPaintingStrategy(PaintingStrategy.Line);
smooth.SetDefaultColor(Color.Cyan);
# End Code PPO

Shareable Link

https://tos.mx/hv8hVf
 

horserider

Well-known member
VIP
The Mobius version BenTen put up is a SMA version of the PPO. The original PPO formula I believe uses the EMA.
skynetgen uses the EMA PPO formula with interesting additions.

If want a simple PPO displayed https://tos.mx/NCheJqs
If want a daily/weekly PPO it is a ToS study. Search studies for it.

I Believe the Ultimate MACD will give equivalent signals plus more info.
 

Baller2356

New member
Can someone give the PPO indicator like the one on Stock charts.com? I know that there is one on this website already. However, it only shows one line. Is there any way you could make it show two lines? Thanks so much!
 

wpwright

New member
Does anyone have PPO that plots, histogram, fast and slow lines? This one has histogram but only plots (1) line. I need the line crossover.
 

wpwright

New member
PPO Indicator is missing (1) plot. Indicator has histogram and (1) plot, there is supposed to be a fast line and a slow line (2) line plots. I need the cross over of the line plots for signal generation.
 

grasshopper123

New member
I 2nd, 3rd, and 4th a request for PPO indicator like the one on Stock charts.com or freestockcharts.com :)
Of course I could be doing something wrong but the ones I've tried from here (and yes I adjust the settings as appropriate so they match) give results that differ from each other and the MACD included in TOS.
Thanks in advance
 

MerryDay

Well-known member
VIP
@grasshopper123 A 2nd, 3rd, and 4th request will probably not yield any further results. If you tried what is on this site, what are you expecting?

@wpwright I did was a simple google search, I am assuming that you did also and already saw this Easycator PPO w/ fast and slow lines and it wasn't what you wanted.

However here it is for anyone in the future that has this request:

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2016
#
## created by North Vanhooser

declare lower;

input fastPeriod   = 12;
input slowPeriod   = 26;
input signalPeriod = 9;
input price        = close;

def fastEma   = ExpAverage( price, fastPeriod );
def slowEma   = ExpAverage( price, slowPeriod );
def periodOK  = fastPeriod < slowPeriod;
AddLabel( !periodOK, "ERROR: fastPeriod MUST be less than slowPeriod" );
def _ppo      = if periodOK then ((fastEma - slowEma) / slowEma) * 100 else 0;
def _signal   = ExpAverage( _ppo, signalPeriod );

plot Ppo      = _ppo;
Ppo.SetDefaultColor( Color.BLUE );
Ppo.HideBubble();

plot PpoEma   = _signal;
PpoEma.SetDefaultColor( Color.CYAN );
PpoEma.HideBubble();

plot zeroLine = 0;
zeroLine.HideBubble();
zeroLine.AssignValueColor( Color.BLACK );

plot PpoH1    = _ppo - _signal;
PpoH1.SetPaintingStrategy( PaintingStrategy.HISTOGRAM );
PpoH1.DefineColor("Up", Color.UPTICK);
PpoH1.DefineColor("Down", Color.DOWNTICK);
PpoH1.DefineColor("Flat", Color.GRAY);
PpoH1.AssignValueColor( if PpoH1 > PpoH1[1] then
                           PpoH1.Color("Up")
                       else
                         if PpoH1 < PpoH1[1] then
                           PpoH1.Color("Down")
                       else
                           PpoH1.Color("Flat"));
PpoH1.HideBubble();
PpoH1.SetLineWeight( 3 );


Here is the shared link: http://tos.mx/zQ6P90
 
Last edited:

Similar threads

Top