How to make the NMACD as an upper study?

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.

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:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
319 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top