Moving Average Clouds Indicator for ThinkorSwim


Active member
2019 Donor
Can this be changed to reflect just a 20 TEMA only?

input price = close;

input averageType1 = {default Simple, Exponential, Weighted, Wilders, Hull};

input averageType2 = {default Simple, Exponential, Weighted, Wilders, Hull};

input length1 =10;

input length2 =20;

def ma1 = MovingAverage( averageType = averageType1,price, length1);

def ma2 = MovingAverage( averageType = averageType2,price, length2);

AddCloud(ma2, ma1, Color.lIGHT_GRAY,;
Last edited by a moderator:
Sure, most likely. Comment out (put a #) in front of the lines you don't want and see what happens. That's the best way to learn.
Between Wilders & Hull in the Input, place TEMA. Where did this script come from? Jus' curious.
thanks again. I think it came from fun with thinkscript. I found it to be interesting. I'm used to working with the ichimoku cloud so this was very visual for me.
There are a number of Ichimoku things in the universe of think script onenote such as customizations, etc. Some people really like it, I do not use it, but if it works for you that is great! Good Trading, Markos
Yes Markos I noticed there are many Ichimoku things. I just use the cloud and find it works well for me. I like simple and for me less is more.
Good trading to you. I'm very glad I found this site, very helpful and friendly.
How about a script consisting of a moving average cloud with the two averages based on the open and the close. Along with alarms which delineate whether long or short?
@Namor You need to change the source code to change the cloud colors.

input show_ma = no;
input length = 10;
input averageType = AverageType.SIMPLE;
def nan = Double.NaN;

def open_ma = MovingAverage(averageType, open, length);
def close_ma = MovingAverage(averageType, close, length);

plot MovAvg_open = if show_ma then MovingAverage(averageType, open, length)
else nan;
plot MovAvg_close = if show_ma then MovingAverage(averageType, close, length) else nan;

AddCloud(close_ma, open_ma, color.GREEN, color.RED);
Last edited by a moderator:
I would like to find or create a colored band between two moving averages (for example, 9sma high and 9sma low). If anyone could help that would be awesome.

Edit: What I mean is that I want a colored cloud between the two moving averages.
@Chence27 Take a look at the AddCloud() syntax here.

Here is an example

input length = 9;
input displace = 0;
input showBreakoutSignals = no;

plot EMA_h = ExpAverage(high[-displace], length);
plot EMA_l = ExpAverage(low[-displace], length);

AddCloud(EMA_h, EMA_l,,;

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
314 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.