# 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;``````

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

87k+ Posts
126 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?