Cloud Overlay Indicator v2 & v3 for ThinkOrSwim

Townsend

Active member
VIP
I've been using Cloud Overlay v3 for a while. Works real good! Here's a 5 minute chart. Basically it's just a 2 moving averages drawn as a single cloud. What makes it so versatile is how you can use different moving averages for different situations. In this example I have 30 and 90 Weighted moving average for the long term signal. And a 20 and 60 Hull moving average for the short term signal. It's pretty simple, but effective, especially if you like moving averages. Easily switch between moving average types: Simply, Exponential, Weighted, Wilders, & Hull.

Originally I wrote this as a multi-time-frame indication, but turns out, I find this simplified version more useful. Especially since it works on tick and range charts. Where the multi-time frame version does not. I'll also include the code for the multi-time frame version below.

7kA5qK2.png


Code:
## Cloud Overlay v3, 3-2020, Paul Townsend
## works on tick and range charts.
input fastLength = 30;
input slowLength = 90;
input smooth = 4;
input averageType = AverageType.hull;

def price = hl2;

plot fastAvg = MovingAverage(averageType, price, fastLength);
plot slowAvg = MovingAverage(averageType, price, slowLength);
fastAvg.hide();
slowAvg.hide();
fastAvg.setlineWeight(3);
slowAvg.setlineWeight(3);

fastAvg.assignValueColor(color.white);
slowAvg.assignValueColor(color.orange);

addcloud(fastAvg,slowAvg,color.cyan,color.magenta);
addlabel(yes,fastLength + "/" + slowLength,color.white);


Below is the code for multi-time frame version which does NOT work on tick and range charts.
Code:
## Cloud Overlay v2, 2-2020, Paul Townsend
## multi-time frame version does NOT works on tick and range charts.

input usePeriod = aggregationperiod.five_MIN;
input fastLength = 30;
input slowLength = 90;
input smooth = 4;
input averageType = AverageType.hull;

def price = open(period = usePeriod);

plot fastAvg = MovingAverage(averageType, price, fastLength);
plot slowAvg = MovingAverage(averageType, price, slowLength);
fastAvg.hide();
slowAvg.hide();
fastAvg.setlineWeight(3);
slowAvg.setlineWeight(3);

fastAvg.assignValueColor(color.white);
slowAvg.assignValueColor(color.orange);

addcloud(fastAvg,slowAvg,color.cyan,color.magenta);
addlabel(yes,"OL=" + useperiod/60000,color.white);
 
Last edited:
Oh... In case you want to see what the multi-time frame version looks like. Here's a 3 minute chart with a 5 minute cloud overlay AND a 10 minute cloud overlay. In addition to setting the time-frame of the cloud, you can also adjust the length of both the short and long periods. See source code above.
rUS7usB.png
 
@Townsend Thanks for posting, looks great! Can you please explain how to interpret this, or at least, how you do... and when there might be a buy and sell signal? Possible to add orders to code for backtesting? Thank you!
 
@ext99k Basically I use the Weighted moving average to assess the trend. The Wilders moving average to assess the long term trend. AND the Hull moving average to give me a heads up as to when the immediate trend is about to change, as it always turns down first.

For best results, you will need to tweak the code yourself. In my current version, (which I'm not posting), I've gotten rid of the clouds completely as they only change color when two line cross, which is well after both have turned down. Instead I color the line itself cyan or magenta, depending on whether it's going up or down. This way, as soon as the lines turn down, the color changes and I see the trend change.

ALSO, as the various lines change color and cross, they form repetitive patterns. Pay attention to these as they tend to imply the quickness and or validity of the impending trend change.
 
Bro, I use Ichimoku, your cloud crushed Ichi. What other indicators work well with this? I'm so excited and confused rn
TY
 
Great indicator @Townsend. I especially like using the MTF version as it shows when price is clearly moving out of consolidation. I'm trying to add the ability to control the opacity of the clouds, but I'm a trader not a coder. Can anyone help add that bit of coding? It should be fairly simple, but I haven't been successful. Ideally I would like the clouds to be very faint so they don't distract from the price action itself.

Thanks, and again great indicator!
 
Great indicator with a nice visual. Thank you for sharing. What would a code look like for a single moving average in a single cloud? thank you
 

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
427 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