JP782
Active member
Is there a way to make this NMACD so all its plots show as an upper study?
I searched around cant find any or anything to serve as a true guide to do it myself, from what I understand this has to be "scaled" or "normalized"???
Yes I know abt the MACD RSI overlay by @samer800 ... that study is completely different from this, I did try to use it as a guide(after stripping it down to just the MACD) but theres nothing between the two thats similar, not to mention that study uses an adaptive MA.
Aside from shutting off declare lower, turning on Left Axis in Chart and Study settings**, can this be done so the plots are relative to price/candlesticks?
**Turning on Left Axis in the Studies settings will overlay this over a chart but it is independent from the bars, a literal overlay, if you use the right side chart size adjustment, as you make the bars longer or shorter this will not be effected. I want it to plot just as any moving average or whatever upper study ppl use.
I searched around cant find any or anything to serve as a true guide to do it myself, from what I understand this has to be "scaled" or "normalized"???
Yes I know abt the MACD RSI overlay by @samer800 ... that study is completely different from this, I did try to use it as a guide(after stripping it down to just the MACD) but theres nothing between the two thats similar, not to mention that study uses an adaptive MA.
Aside from shutting off declare lower, turning on Left Axis in Chart and Study settings**, can this be done so the plots are relative to price/candlesticks?
**Turning on Left Axis in the Studies settings will overlay this over a chart but it is independent from the bars, a literal overlay, if you use the right side chart size adjustment, as you make the bars longer or shorter this will not be effected. I want it to plot just as any moving average or whatever upper study ppl use.
Code:
#Normalized MACD
declare lower;
def na = Double.NaN;
input sma = 12;
input lma = 21;
input tsp = 9;
input np = 50;
input levels = yes;
input midL = -.9;
input midH = .9;
input avg_type = AverageType.EXPONENTIAL;
def sh = MovingAverage(avg_type, close, sma);
def lon = MovingAverage(avg_type, close, lma);
def ratio = Min(sh, lon) / Max(sh, lon);
def Mac = If(sh > lon, 2 - ratio, ratio) - 1;
def MacNorm = ((Mac - Lowest(Mac, np)) / (Highest(Mac, np) - Lowest(Mac, np) + .000001) * 2) - 1;
def MacNorm2 = If(np < 2, Mac, MacNorm);
def Trigger = WMA(MacNorm2, tsp);
plot z2 = MacNorm2;
z2.SetDefaultColor(Color.BLACK);
plot z4 = Trigger;
z4.SetDefaultColor(Color.RED);
plot z = 0;
z.SetDefaultColor(Color.GRAY);
z.SetLineWeight(1);
plot fiftyU = .50;
plot fiftyD = -.50;
fiftyU.SetDefaultColor(Color.BLACK);
fiftyD.SetDefaultColor(Color.BLACK);
fiftyU.SetHiding(!levels);
fiftyD.SetHiding(!levels);
plot Midhi = midH;
Midhi.SetStyle(Curve.SHORT_DASH);
Midhi.SetHiding(!levels);
plot Midlow = midL;
Midlow.SetStyle(Curve.SHORT_DASH);
Midlow.SetHiding(!levels);
Last edited by a moderator: