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:

Townsend

Active member
VIP
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
 

ext99k

Member
@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!
 

Townsend

Active member
VIP
@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.
 

lostmarxbro

New member
Bro, I use Ichimoku, your cloud crushed Ichi. What other indicators work well with this? I'm so excited and confused rn
TY
 

sparhawk

New member
VIP
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!
 

mikeraya

New member
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
 

Similar threads

Top