Price Momentum Indicator PMO
I've taken TDA's PMO script and modified it to show a histogram. From what I've read PMO works like MACD, but may be better, especially for comparing stocks.
Shared Study Link: http://tos.mx/vgU8XzK
Click here for --> Easiest way to load shared links
I've taken TDA's PMO script and modified it to show a histogram. From what I've read PMO works like MACD, but may be better, especially for comparing stocks.
Ruby:
## PMO_Histogram
## ver 21.08.06.0
## TD Ameritrade's script modified by theLEMband to produce a histogram
## ver 21.08.09.0
## Modified to include the ability to switch PMO/signal lines off/on
## ver 21.08.18.0
## Fixed histogram coloring error
declare lower;
input price = close;
input length1 = 35;
input length2 = 20;
input signalLength = 10;
input plotlines = yes;
def rate = 100 * (price - price[1]) / price[1];
def PMOCalc = ExpAverage(10 * ExpAverage(rate, length1), length2);
def SignalLineCalc = ExpAverage(PMOcalc, signalLength);
def PMODiffCalc = PMOCalc - SignalLineCalc;
plot PMO = if plotlines then pmoCalc else Double.NaN;
plot SignalLine = if plotlines then SignalLineCalc else Double.NaN;
plot PMODiff = PMODiffCalc;
plot ZeroLine = 0;
AddCloud(PMO, SignalLine, Color.GREEN, Color.RED);
PMO.SetDefaultColor(GetColor(1));
SignalLine.SetDefaultColor(GetColor(3));
ZeroLine.SetDefaultColor(GetColor(7));
PMODiff.SetDefaultColor(GetColor(5));
PMODiff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
PMODiff.SetLineWeight(3);
PMODiff.DefineColor("Positive and Up", Color.GREEN);
PMODiff.DefineColor("Positive and Down", Color.DARK_GREEN);
PMODiff.DefineColor("Negative and Down", Color.RED);
PMODiff.DefineColor("Negative and Up", Color.DARK_RED);
PMODiff.AssignValueColor(if PMODiff >= 0 then if PMODiff > PMODiff[1] then PMODiff.color("Positive and Up") else PMODiff.color("Positive and Down") else if PMODiff < PMODiff[1] then PMODiff.Color("Negative and Down") else PMODiff.Color("Negative and Up"));
## End Code##
Click here for --> Easiest way to load shared links
Last edited: