Moving Average Channels

jdn717

New member
This is my first post on this forum so please bear with me if this is a newb question. I am wanting to create/obtain a thinkscript based indicator that plots 2 identical moving averages spaced apart by a number based on the right axis. The "upperMovingAverage" would reflect the correct MA values, whereas the lower would be "upperMovingAverage - x", where x is a number/price from the right axis. The result would be two moving averages moving in sync, yet separated by a setting variable. Hope this makes sense. Id like to know how I would get started or what functions would be required. Or, if someone could whip it up that would be nice too.

PS, the reason Im doing this is to plot two 377 day (252 trading days per year + a half year) moving averages in parallel on the PCALL. If you plot one you'll see that the 377 shows us the market extreme at .6. I want to see the same MA plotted so it aligns with lower extreme. Which the market appears to be defining as .4.

Thanks!
 
@jdn717 Based on what you have defined in your post, I've simply taken the 377-day SMA and subtracted the difference between .6 and .4. you can use it as a template and adjust the subtracted value to whichever you prefer.
Code:
plot line1 = average(close,377);
plot line2 = line1 - .2;

Just a thought, given that you want the values to be at .6 and .4 - why not plot straight lines?
Code:
plot x = 0.6;
plot xx = 0.4;
 

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

Thanks, that helped and I figured it out. I put a .3 offset instead. The reason I dont use a flat line is because the threshold seem to change over time. A year or so ago the threshold was .8, now it seems to be .6 and .3
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
500 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