Moving Average Clouds Indicator for ThinkorSwim

tenacity11

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

Code:
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,  Color.pink);
 
Last edited by a moderator:

markos

Well-known member
VIP
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.
 

tenacity11

Active member
2019 Donor
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.
 

markos

Well-known member
VIP
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
 

tenacity11

Active member
2019 Donor
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.
 

Namor

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

generic

Active member
@Namor You need to change the source code to change the cloud colors.

Code:
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:

Chence27

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

BenTen

Administrative
Staff
VIP
@Chence27 Take a look at the AddCloud() syntax here.

Here is an example

Code:
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, color.green, color.green);
 

Similar threads

Top