Ripster Clouds For ThinkOrSwim

useThinkScript

Administrative
Staff member
Staff
VIP
Lifetime
Ribster Cloud System For ThinkOrSwim
qXlM3Oq.png

Ripster states:
  • Focus is on 10-min chart
  • Focus first on 34-50ema cloud. These clouds act as support and resistance.
  • Over 50ema trend is bullish; below is Bearish.
  • Whether you are long or short, that 34-50ema cloud is your risk level
  • Many times a stock will change trend right on these clouds.

You have to be disciplined if the stock crosses over the cloud, then long becomes short and short becomes long.

On Gap Down:
You want to short, if they are under 10-min 50ema cloud and get rejected.
You want to go long, if they move above.

Other things to consider:
  • Look for higher highs/lows on 10-min when going long
  • Lower lows/highs for shorting
5-12 cloud cross is your confirmation
  • Go long when 5 crosses above 12
  • Short when 12 is under 5
Volume is key
If stock has done 20% of its average volume in the 1st 30-min; it will trend in the same direction.

Opening Range Breaks
Add ORB to this system for your intraday trades at open.


Important:
Let the trend ride as long as the 10-min candle rides the 5-12 (or 5-13) cloud.
For more conviction, you can create a 8-9ema cloud ribbon as well.

Ruby:
# Ripster Cloud System
#Multiple EMA Cloud

input ema1low = 5;
input ema1high = 13;
input ema2low = 8;
input ema2high = 9;
input ema3low = 34;
input ema3high = 50;
input ema6low = 20;
input ema6high = 21;



def ema5 = ExpAverage(hl2, ema1low);
def ema13 = ExpAverage(hl2, ema1high);
AddCloud(ema5, ema13, CreateColor(76, 175, 80), CreateColor(244, 67, 54));
def ema8 = ExpAverage(hl2, ema2low);
def ema9 = ExpAverage(hl2, ema2high);
AddCloud(ema8, ema9, CreateColor(3, 97, 30), CreateColor(136, 14, 79));
def ema34 = ExpAverage(hl2, ema3low);
def ema50 = ExpAverage(hl2, ema3high);
AddCloud(ema34, ema50, CreateColor(33, 150, 243), CreateColor(255, 183, 77));
def ema20 = ExpAverage(hl2, ema6low);
def ema21= ExpAverage(hl2, ema6high);
AddCloud(ema20,ema21, CreateColor(107, 205, 117), CreateColor(230, 61, 19));

For more information, here is Ribster's site link:
https://www.ripstereducation.com/ripster-clouds-explained
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

I've been trying to code a label for the MTF 5 and 21 EMA cross but haven't had any luck. Any chance that you may have coded this? Thanks.
 
@Cindy
Code:
input agg = aggregationperiod.day;

def ma1 = expaverage(close(period = agg), 5);
def ma2 = expaverage(close(period = agg), 21);

AddLabel(1, if ma1 > ma2 then " 5ma is above 21ma " else if ma1 == ma2 then " 5ma is equal to 21ma " else " 5ma is below 21ma", if ma1 > ma2 then color.green else if ma1 == ma2 then color.white else color.red);
 
Thank for your response

I don't see 15 minutes chart in the code. My request is

9 ema = 5 minutes Chart
9 ema = 15 minutes chart

Whenever 9 ema if 5 minutes cross 9ema of 15 minutes above or below . I need to get alert and scanner..
 
@sanjeev_mail My earlier post above was directed to @Cindy.

In regards to your request, I do not believe that using multiple aggregations will function in TOS scans. It would probably be far easier to find the equivalent length of the 15 min 9 EMA on the 5 min chart and scan for that moving average cross.
 
@Cindy
Code:
input agg = aggregationperiod.day;
[ICODE][/ICODE]
def ma1 = expaverage(close(period = agg), 5);
def ma2 = expaverage(close(period = agg), 21);

AddLabel(1, if ma1 > ma2 then " 5ma is above 21ma " else if ma1 == ma2 then " 5ma is equal to 21ma " else " 5ma is below 21ma", if ma1 > ma2 then color.green else if ma1 == ma2 then color.white else color.red);
Thanks for the reply. I was looking for a label that had multi time frames-let’s say from 1 minute to weekly. It was something I saw in a video. I think they called it the multi time frame cross.
@Cindy
Code:
input agg = aggregationperiod.day;

def ma1 = expaverage(close(period = agg), 5);
def ma2 = expaverage(close(period = agg), 21);

AddLabel(1, if ma1 > ma2 then " 5ma is above 21ma " else if ma1 == ma2 then " 5ma is equal to 21ma " else " 5ma is below 21ma", if ma1 > ma2 then color.green else if ma1 == ma2 then color.white else color.red);
Thanks for the reply. I was looking for a label that had multi time frames-let’s say from 1 minute to weekly. It was something I saw in a video. I think they called it the multi time frame cross. I’m not sure how to post an image of this.
 
Thanks for the reply. I was looking for a label that had multi time frames-let’s say from 1 minute to weekly. It was something I saw in a video. I think they called it the multi time frame cross.
@Cindy The above label code has an input that can be changed to whatever aggregation you want. However, here is an example of multiple aggregation labels together. A limitation of combining aggregations in this way is that your chart aggregation must always be equal to or lower than the shortest aggregation label in order to see any of the labels.

To add additional aggregations, simply duplicate the method used.

Code:
def agg1 = aggregationperiod.five_min;
def agg2 = aggregationperiod.ten_min;
def agg3 = aggregationperiod.fifteen_min;
def agg4 = aggregationperiod.thirty_min;
def agg5 = aggregationperiod.hour;
def agg6 = aggregationperiod.day;
def agg7 = aggregationperiod.week;

def ma1 = expaverage(close(period = agg1), 5) > expaverage(close(period = agg1), 21);
def ma2 = expaverage(close(period = agg2), 5) > expaverage(close(period = agg2), 21);
def ma3 = expaverage(close(period = agg3), 5) > expaverage(close(period = agg3), 21);
def ma4 = expaverage(close(period = agg4), 5) > expaverage(close(period = agg4), 21);
def ma5 = expaverage(close(period = agg5), 5) > expaverage(close(period = agg5), 21);
def ma6 = expaverage(close(period = agg6), 5) > expaverage(close(period = agg6), 21);
def ma7 = expaverage(close(period = agg7), 5) > expaverage(close(period = agg7), 21);

AddLabel(1, " 5 ", if ma1 then color.green else color.red);
AddLabel(1, " 10 ", if ma2 then color.green else color.red);
AddLabel(1, " 15 ", if ma3 then color.green else color.red);
AddLabel(1, " 30 ", if ma4 then color.green else color.red);
AddLabel(1, " HR ", if ma5 then color.green else color.red);
AddLabel(1, " D ", if ma6 then color.green else color.red);
AddLabel(1, " W ", if ma7 then color.green else color.red);
labels.png
 
@Cindy The above label code has an input that can be changed to whatever aggregation you want. However, here is an example of multiple aggregation labels together. A limitation of combining aggregations in this way is that your chart aggregation must always be equal to or lower than the shortest aggregation label in order to see any of the labels.

To add additional aggregations, simply duplicate the method used.

Code:
def agg1 = aggregationperiod.five_min;
def agg2 = aggregationperiod.ten_min;
def agg3 = aggregationperiod.fifteen_min;
def agg4 = aggregationperiod.thirty_min;
def agg5 = aggregationperiod.hour;
def agg6 = aggregationperiod.day;
def agg7 = aggregationperiod.week;

def ma1 = expaverage(close(period = agg1), 5) > expaverage(close(period = agg1), 21);
def ma2 = expaverage(close(period = agg2), 5) > expaverage(close(period = agg2), 21);
def ma3 = expaverage(close(period = agg3), 5) > expaverage(close(period = agg3), 21);
def ma4 = expaverage(close(period = agg4), 5) > expaverage(close(period = agg4), 21);
def ma5 = expaverage(close(period = agg5), 5) > expaverage(close(period = agg5), 21);
def ma6 = expaverage(close(period = agg6), 5) > expaverage(close(period = agg6), 21);
def ma7 = expaverage(close(period = agg7), 5) > expaverage(close(period = agg7), 21);

AddLabel(1, " 5 ", if ma1 then color.green else color.red);
AddLabel(1, " 10 ", if ma2 then color.green else color.red);
AddLabel(1, " 15 ", if ma3 then color.green else color.red);
AddLabel(1, " 30 ", if ma4 then color.green else color.red);
AddLabel(1, " HR ", if ma5 then color.green else color.red);
AddLabel(1, " D ", if ma6 then color.green else color.red);
AddLabel(1, " W ", if ma7 then color.green else color.red);
labels.png
Thanks. That works great.
 
This is Ripsters Trend Labels.
http://tos.mx/OrRDL76
yhWKif2.png

Ruby:
input MAtype = AverageType.EXPONENTIAL;
input ShortAverage = 5;
input LongAverage = 21;

def MA_month_close;
def MA_month_shortAvg;
def MA_month_longAvg;
def MA_month_higher;
def MA_month_lower;
def MA_month_same;
def MA_month_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.MONTH {
    MA_month_close = close(period="Month");
    MA_month_shortAvg = MovingAverage(MAtype, MA_month_close, ShortAverage);
    MA_month_longAvg = MovingAverage(MAtype,MA_month_close, LongAverage);
    MA_month_nowcrossing = if Crosses(MA_month_shortAvg, MA_month_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_month_same = if MA_month_nowcrossing == 1 then 1 else Double.NaN;
    if MA_month_same == 1 {
        MA_month_higher = Double.NaN;
        MA_month_lower = Double.NaN;
    } else {
        MA_month_higher = if MA_month_shortAvg >= MA_month_longAvg[1] then 1 else Double.NaN;
        MA_month_lower = if MA_month_shortAvg < MA_month_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_month_close = 0;
    MA_month_shortAvg = 0;
    MA_month_longAvg = 0;
    MA_month_higher = Double.NaN;
    MA_month_lower = Double.NaN;
    MA_month_same = Double.NaN;
    MA_month_nowcrossing = 0;
}
AddLabel(MA_month_higher, "M", Color.DARK_GREEN);
AddLabel(MA_month_lower, "M", Color.DARK_RED);
AddLabel(MA_month_same, "M", Color.WHITE);

def MA_week_close;
def MA_week_shortAvg;
def MA_week_longAvg;
def MA_week_higher;
def MA_week_lower;
def MA_week_same;
def MA_week_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.WEEK {
    MA_week_close = close(period="Week");
    MA_week_shortAvg = MovingAverage(MAtype, MA_week_close, ShortAverage);
    MA_week_longAvg = MovingAverage(MAtype,MA_week_close, LongAverage);
    MA_week_nowcrossing = if Crosses(MA_week_shortAvg, MA_week_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_week_same = if MA_week_nowcrossing == 1 then 1 else Double.NaN;
    if MA_week_same == 1 {
        MA_week_higher = Double.NaN;
        MA_week_lower = Double.NaN;
    } else {
        MA_week_higher = if MA_week_shortAvg >= MA_week_longAvg[1] then 1 else Double.NaN;
        MA_week_lower = if MA_week_shortAvg < MA_week_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_week_close = 0;
    MA_week_shortAvg = 0;
    MA_week_longAvg = 0;
    MA_week_higher = Double.NaN;
    MA_week_lower = Double.NaN;
    MA_week_same = Double.NaN;
    MA_week_nowcrossing = 0;
}
AddLabel(MA_week_higher, "W", Color.DARK_GREEN);
AddLabel(MA_week_lower, "W", Color.DARK_RED);
AddLabel(MA_week_same, "W", Color.WHITE);

def MA_4day_close;
def MA_4day_shortAvg;
def MA_4day_longAvg;
def MA_4day_higher;
def MA_4day_lower;
def MA_4day_same;
def MA_4day_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.FOUR_DAYS {
    MA_4day_close = close(period="4 days");
    MA_4day_shortAvg = MovingAverage(MAtype, MA_4day_close, ShortAverage);
    MA_4day_longAvg = MovingAverage(MAtype,MA_4day_close, LongAverage);
    MA_4day_nowcrossing = if Crosses(MA_4day_shortAvg, MA_4day_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_4day_same = if MA_4day_nowcrossing == 1 then 1 else Double.NaN;
    if MA_4day_same == 1 {
        MA_4day_higher = Double.NaN;
        MA_4day_lower = Double.NaN;
    } else {
        MA_4day_higher = if MA_4day_shortAvg >= MA_4day_longAvg[1] then 1 else Double.NaN;
        MA_4day_lower = if MA_4day_shortAvg < MA_4day_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_4day_close = 0;
    MA_4day_shortAvg = 0;
    MA_4day_longAvg = 0;
    MA_4day_higher = Double.NaN;
    MA_4day_lower = Double.NaN;
    MA_4day_same = Double.NaN;
    MA_4day_nowcrossing = 0;
}
AddLabel(MA_4day_higher, "4D", Color.DARK_GREEN);
AddLabel(MA_4day_lower, "4D", Color.DARK_RED);
AddLabel(MA_4day_same, "4D", Color.WHITE);

def MA_3day_close;
def MA_3day_shortAvg;
def MA_3day_longAvg;
def MA_3day_higher;
def MA_3day_lower;
def MA_3day_same;
def MA_3day_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.THREE_DAYS {
    MA_3day_close = close(period="3 days");
    MA_3day_shortAvg = MovingAverage(MAtype, MA_3day_close, ShortAverage);
    MA_3day_longAvg = MovingAverage(MAtype,MA_3day_close, LongAverage);
    MA_3day_nowcrossing = if Crosses(MA_3day_shortAvg, MA_3day_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_3day_same = if MA_3day_nowcrossing == 1 then 1 else Double.NaN;
    if MA_3day_same == 1 {
        MA_3day_higher = Double.NaN;
        MA_3day_lower = Double.NaN;
    } else {
        MA_3day_higher = if MA_3day_shortAvg >= MA_3day_longAvg[1] then 1 else Double.NaN;
        MA_3day_lower = if MA_3day_shortAvg < MA_3day_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_3day_close = 0;
    MA_3day_shortAvg = 0;
    MA_3day_longAvg = 0;
    MA_3day_higher = Double.NaN;
    MA_3day_lower = Double.NaN;
    MA_3day_same = Double.NaN;
    MA_3day_nowcrossing = 0;
}
AddLabel(MA_3day_higher, "3D", Color.DARK_GREEN);
AddLabel(MA_3day_lower, "3D", Color.DARK_RED);
AddLabel(MA_3day_same, "3D", Color.WHITE);

def MA_2day_close;
def MA_2day_shortAvg;
def MA_2day_longAvg;
def MA_2day_higher;
def MA_2day_lower;
def MA_2day_same;
def MA_2day_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.TWO_DAYS {
    MA_2day_close = close(period="2 days");
    MA_2day_shortAvg = MovingAverage(MAtype, MA_2day_close, ShortAverage);
    MA_2day_longAvg = MovingAverage(MAtype,MA_2day_close, LongAverage);
    MA_2day_nowcrossing = if Crosses(MA_2day_shortAvg, MA_2day_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_2day_same = if MA_2day_nowcrossing == 1 then 1 else Double.NaN;
    if MA_2day_same == 1 {
        MA_2day_higher = Double.NaN;
        MA_2day_lower = Double.NaN;
    } else {
        MA_2day_higher = if MA_2day_shortAvg >= MA_2day_longAvg[1] then 1 else Double.NaN;
        MA_2day_lower = if MA_2day_shortAvg < MA_2day_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_2day_close = 0;
    MA_2day_shortAvg = 0;
    MA_2day_longAvg = 0;
    MA_2day_higher = Double.NaN;
    MA_2day_lower = Double.NaN;
    MA_2day_same = Double.NaN;
    MA_2day_nowcrossing = 0;
}
AddLabel(MA_2day_higher, "2D", Color.DARK_GREEN);
AddLabel(MA_2day_lower, "2D", Color.DARK_RED);
AddLabel(MA_2day_same, "2D", Color.WHITE);

def MA_1day_close;
def MA_1day_shortAvg;
def MA_1day_longAvg;
def MA_1day_higher;
def MA_1day_lower;
def MA_1day_same;
def MA_1day_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.DAY {
    MA_1day_close = close(period="Day");
    MA_1day_shortAvg = MovingAverage(MAtype, MA_1day_close, ShortAverage);
    MA_1day_longAvg = MovingAverage(MAtype,MA_1day_close, LongAverage);
    MA_1day_nowcrossing = if Crosses(MA_1day_shortAvg, MA_1day_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_1day_same = if MA_1day_nowcrossing == 1 then 1 else Double.NaN;
    if MA_1day_same == 1 {
        MA_1day_higher = Double.NaN;
        MA_1day_lower = Double.NaN;
    } else {
        MA_1day_higher = if MA_1day_shortAvg >= MA_1day_longAvg[1] then 1 else Double.NaN;
        MA_1day_lower = if MA_1day_shortAvg < MA_1day_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_1day_close = 0;
    MA_1day_shortAvg = 0;
    MA_1day_longAvg = 0;
    MA_1day_higher = Double.NaN;
    MA_1day_lower = Double.NaN;
    MA_1day_same = Double.NaN;
    MA_1day_nowcrossing = 0;
}
AddLabel(MA_1day_higher, "1D", Color.DARK_GREEN);
AddLabel(MA_1day_lower, "1D", Color.DARK_RED);
AddLabel(MA_1day_same, "1D", Color.WHITE);

def MA_4hour_close;
def MA_4hour_shortAvg;
def MA_4hour_longAvg;
def MA_4hour_higher;
def MA_4hour_lower;
def MA_4hour_same;
def MA_4hour_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.FOUR_HOURS {
    MA_4hour_close = close(period="4 hours");
    MA_4hour_shortAvg = MovingAverage(MAtype, MA_4hour_close, ShortAverage);
    MA_4hour_longAvg = MovingAverage(MAtype,MA_4hour_close, LongAverage);
    MA_4hour_nowcrossing = if Crosses(MA_4hour_shortAvg, MA_4hour_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_4hour_same = if MA_4hour_nowcrossing == 1 then 1 else Double.NaN;
    if MA_4hour_same == 1 {
        MA_4hour_higher = Double.NaN;
        MA_4hour_lower = Double.NaN;
    } else {
        MA_4hour_higher = if MA_4hour_shortAvg >= MA_4hour_longAvg[1] then 1 else Double.NaN;
        MA_4hour_lower = if MA_4hour_shortAvg < MA_4hour_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_4hour_close = 0;
    MA_4hour_shortAvg = 0;
    MA_4hour_longAvg = 0;
    MA_4hour_higher = Double.NaN;
    MA_4hour_lower = Double.NaN;
    MA_4hour_same = Double.NaN;
    MA_4hour_nowcrossing = 0;
}
AddLabel(MA_4hour_higher, "4h", Color.DARK_GREEN);
AddLabel(MA_4hour_lower, "4h", Color.DARK_RED);
AddLabel(MA_4hour_same, "4h", Color.WHITE);

def MA_2hour_close;
def MA_2hour_shortAvg;
def MA_2hour_longAvg;
def MA_2hour_higher;
def MA_2hour_lower;
def MA_2hour_same;
def MA_2hour_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.TWO_HOURS {
    MA_2hour_close = close(period="2 hours");
    MA_2hour_shortAvg = MovingAverage(MAtype, MA_2hour_close, ShortAverage);
    MA_2hour_longAvg = MovingAverage(MAtype,MA_2hour_close, LongAverage);
    MA_2hour_nowcrossing = if Crosses(MA_2hour_shortAvg, MA_2hour_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_2hour_same = if MA_2hour_nowcrossing == 1 then 1 else Double.NaN;
    if MA_2hour_same == 1 {
        MA_2hour_higher = Double.NaN;
        MA_2hour_lower = Double.NaN;
    } else {
        MA_2hour_higher = if MA_2hour_shortAvg >= MA_2hour_longAvg[1] then 1 else Double.NaN;
        MA_2hour_lower = if MA_2hour_shortAvg < MA_2hour_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_2hour_close = 0;
    MA_2hour_shortAvg = 0;
    MA_2hour_longAvg = 0;
    MA_2hour_higher = Double.NaN;
    MA_2hour_lower = Double.NaN;
    MA_2hour_same = Double.NaN;
    MA_2hour_nowcrossing = 0;
}
AddLabel(MA_2hour_higher, "2h", Color.DARK_GREEN);
AddLabel(MA_2hour_lower, "2h", Color.DARK_RED);
AddLabel(MA_2hour_same, "2h", Color.WHITE);

def MA_1hour_close;
def MA_1hour_shortAvg;
def MA_1hour_longAvg;
def MA_1hour_higher;
def MA_1hour_lower;
def MA_1hour_same;
def MA_1hour_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.HOUR {
    MA_1hour_close = close(period="1 hour");
    MA_1hour_shortAvg = MovingAverage(MAtype, MA_1hour_close, ShortAverage);
    MA_1hour_longAvg = MovingAverage(MAtype,MA_1hour_close, LongAverage);
    MA_1hour_nowcrossing = if Crosses(MA_1hour_shortAvg, MA_1hour_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_1hour_same = if MA_1hour_nowcrossing == 1 then 1 else Double.NaN;
    if MA_1hour_same == 1 {
        MA_1hour_higher = Double.NaN;
        MA_1hour_lower = Double.NaN;
    } else {
        MA_1hour_higher = if MA_1hour_shortAvg >= MA_1hour_longAvg[1] then 1 else Double.NaN;
        MA_1hour_lower = if MA_1hour_shortAvg < MA_1hour_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_1hour_close = 0;
    MA_1hour_shortAvg = 0;
    MA_1hour_longAvg = 0;
    MA_1hour_higher = Double.NaN;
    MA_1hour_lower = Double.NaN;
    MA_1hour_same = Double.NaN;
    MA_1hour_nowcrossing = 0;
}
AddLabel(MA_1hour_higher, "1h", Color.DARK_GREEN);
AddLabel(MA_1hour_lower, "1h", Color.DARK_RED);
AddLabel(MA_1hour_same, "1h", Color.WHITE);

def MA_30min_close;
def MA_30min_shortAvg;
def MA_30min_longAvg;
def MA_30min_higher;
def MA_30min_lower;
def MA_30min_same;
def MA_30min_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.THIRTY_MIN {
    MA_30min_close = close(period="30 min");
    MA_30min_shortAvg = MovingAverage(MAtype, MA_30min_close, ShortAverage);
    MA_30min_longAvg = MovingAverage(MAtype,MA_30min_close, LongAverage);
    MA_30min_nowcrossing = if Crosses(MA_30min_shortAvg, MA_30min_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_30min_same = if MA_30min_nowcrossing == 1 then 1 else Double.NaN;
    if MA_30min_same == 1 {
        MA_30min_higher = Double.NaN;
        MA_30min_lower = Double.NaN;
    } else {
        MA_30min_higher = if MA_30min_shortAvg >= MA_30min_longAvg[1] then 1 else Double.NaN;
        MA_30min_lower = if MA_30min_shortAvg < MA_30min_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_30min_close = 0;
    MA_30min_shortAvg = 0;
    MA_30min_longAvg = 0;
    MA_30min_higher = Double.NaN;
    MA_30min_lower = Double.NaN;
    MA_30min_same = Double.NaN;
    MA_30min_nowcrossing = 0;
}
AddLabel(MA_30min_higher, "30m", Color.DARK_GREEN);
AddLabel(MA_30min_lower, "30m", Color.DARK_RED);
AddLabel(MA_30min_same, "30m", Color.WHITE);

def MA_15min_close;
def MA_15min_shortAvg;
def MA_15min_longAvg;
def MA_15min_higher;
def MA_15min_lower;
def MA_15min_same;
def MA_15min_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN {
    MA_15min_close = close(period="15 min");
    MA_15min_shortAvg = MovingAverage(MAtype, MA_15min_close, ShortAverage);
    MA_15min_longAvg = MovingAverage(MAtype,MA_15min_close, LongAverage);
    MA_15min_nowcrossing = if Crosses(MA_15min_shortAvg, MA_15min_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_15min_same = if MA_15min_nowcrossing == 1 then 1 else Double.NaN;
    if MA_15min_same == 1 {
        MA_15min_higher = Double.NaN;
        MA_15min_lower = Double.NaN;
    } else {
        MA_15min_higher = if MA_15min_shortAvg >= MA_15min_longAvg[1] then 1 else Double.NaN;
        MA_15min_lower = if MA_15min_shortAvg < MA_15min_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_15min_close = 0;
    MA_15min_shortAvg = 0;
    MA_15min_longAvg = 0;
    MA_15min_higher = Double.NaN;
    MA_15min_lower = Double.NaN;
    MA_15min_same = Double.NaN;
    MA_15min_nowcrossing = 0;
}
AddLabel(MA_15min_higher, "15m", Color.DARK_GREEN);
AddLabel(MA_15min_lower, "15m", Color.DARK_RED);
AddLabel(MA_15min_same, "15m", Color.WHITE);

def MA_10min_close;
def MA_10min_shortAvg;
def MA_10min_longAvg;
def MA_10min_higher;
def MA_10min_lower;
def MA_10min_same;
def MA_10min_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.TEN_MIN {
    MA_10min_close = close(period="10 min");
    MA_10min_shortAvg = MovingAverage(MAtype, MA_10min_close, ShortAverage);
    MA_10min_longAvg = MovingAverage(MAtype,MA_10min_close, LongAverage);
    MA_10min_nowcrossing = if Crosses(MA_10min_shortAvg, MA_10min_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_10min_same = if MA_10min_nowcrossing == 1 then 1 else Double.NaN;
    if MA_10min_same == 1 {
        MA_10min_higher = Double.NaN;
        MA_10min_lower = Double.NaN;
    } else {
        MA_10min_higher = if MA_10min_shortAvg >= MA_10min_longAvg[1] then 1 else Double.NaN;
        MA_10min_lower = if MA_10min_shortAvg < MA_10min_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_10min_close = 0;
    MA_10min_shortAvg = 0;
    MA_10min_longAvg = 0;
    MA_10min_higher = Double.NaN;
    MA_10min_lower = Double.NaN;
    MA_10min_same = Double.NaN;
    MA_10min_nowcrossing = 0;
}
AddLabel(MA_10min_higher, "10m", Color.DARK_GREEN);
AddLabel(MA_10min_lower, "10m", Color.DARK_RED);
AddLabel(MA_10min_same, "10m", Color.WHITE);

def MA_shortAvgmin_close;
def MA_shortAvgmin_shortAvg;
def MA_shortAvgmin_longAvg;
def MA_shortAvgmin_higher;
def MA_shortAvgmin_lower;
def MA_shortAvgmin_same;
def MA_shortAvgmin_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN {
    MA_shortAvgmin_close = close(period="5 min");
    MA_shortAvgmin_shortAvg = MovingAverage(MAtype, MA_shortAvgmin_close, ShortAverage);
    MA_shortAvgmin_longAvg = MovingAverage(MAtype,MA_shortAvgmin_close, LongAverage);
    MA_shortAvgmin_nowcrossing = if Crosses(MA_shortAvgmin_shortAvg, MA_shortAvgmin_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_shortAvgmin_same = if MA_shortAvgmin_nowcrossing == 1 then 1 else Double.NaN;
    if MA_shortAvgmin_same == 1 {
        MA_shortAvgmin_higher = Double.NaN;
        MA_shortAvgmin_lower = Double.NaN;
    } else {
        MA_shortAvgmin_higher = if MA_shortAvgmin_shortAvg >= MA_shortAvgmin_longAvg[1] then 1 else Double.NaN;
        MA_shortAvgmin_lower = if MA_shortAvgmin_shortAvg < MA_shortAvgmin_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_shortAvgmin_close = 0;
    MA_shortAvgmin_shortAvg = 0;
    MA_shortAvgmin_longAvg = 0;
    MA_shortAvgmin_higher = Double.NaN;
    MA_shortAvgmin_lower = Double.NaN;
    MA_shortAvgmin_same = Double.NaN;
    MA_shortAvgmin_nowcrossing = 0;
}
AddLabel(MA_shortAvgmin_higher, "5m", Color.DARK_GREEN);
AddLabel(MA_shortAvgmin_lower, "5m", Color.DARK_RED);
AddLabel(MA_shortAvgmin_same, "5m", Color.WHITE);

def MA_4min_close;
def MA_4min_shortAvg;
def MA_4min_longAvg;
def MA_4min_higher;
def MA_4min_lower;
def MA_4min_same;
def MA_4min_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.FOUR_MIN {
    MA_4min_close = close(period="4 min");
    MA_4min_shortAvg = MovingAverage(MAtype, MA_4min_close, ShortAverage);
    MA_4min_longAvg = MovingAverage(MAtype,MA_4min_close, LongAverage);
    MA_4min_nowcrossing = if Crosses(MA_4min_shortAvg, MA_4min_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_4min_same = if MA_4min_nowcrossing == 1 then 1 else Double.NaN;
    if MA_4min_same == 1 {
        MA_4min_higher = Double.NaN;
        MA_4min_lower = Double.NaN;
    } else {
        MA_4min_higher = if MA_4min_shortAvg >= MA_4min_longAvg[1] then 1 else Double.NaN;
        MA_4min_lower = if MA_4min_shortAvg < MA_4min_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_4min_close = 0;
    MA_4min_shortAvg = 0;
    MA_4min_longAvg = 0;
    MA_4min_higher = Double.NaN;
    MA_4min_lower = Double.NaN;
    MA_4min_same = Double.NaN;
    MA_4min_nowcrossing = 0;
}
AddLabel(MA_4min_higher, "4m", Color.DARK_GREEN);
AddLabel(MA_4min_lower, "4m", Color.DARK_RED);
AddLabel(MA_4min_same, "4m", Color.WHITE);

def MA_3min_close;
def MA_3min_shortAvg;
def MA_3min_longAvg;
def MA_3min_higher;
def MA_3min_lower;
def MA_3min_same;
def MA_3min_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.THREE_MIN {
    MA_3min_close = close(period="3 min");
    MA_3min_shortAvg = MovingAverage(MAtype, MA_3min_close, ShortAverage);
    MA_3min_longAvg = MovingAverage(MAtype,MA_3min_close, LongAverage);
    MA_3min_nowcrossing = if Crosses(MA_3min_shortAvg, MA_3min_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_3min_same = if MA_3min_nowcrossing == 1 then 1 else Double.NaN;
    if MA_3min_same == 1 {
        MA_3min_higher = Double.NaN;
        MA_3min_lower = Double.NaN;
    } else {
        MA_3min_higher = if MA_3min_shortAvg >= MA_3min_longAvg[1] then 1 else Double.NaN;
        MA_3min_lower = if MA_3min_shortAvg < MA_3min_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_3min_close = 0;
    MA_3min_shortAvg = 0;
    MA_3min_longAvg = 0;
    MA_3min_higher = Double.NaN;
    MA_3min_lower = Double.NaN;
    MA_3min_same = Double.NaN;
    MA_3min_nowcrossing = 0;
}
AddLabel(MA_3min_higher, "3m", Color.DARK_GREEN);
AddLabel(MA_3min_lower, "3m", Color.DARK_RED);
AddLabel(MA_3min_same, "3m", Color.WHITE);

def MA_2min_close;
def MA_2min_shortAvg;
def MA_2min_longAvg;
def MA_2min_higher;
def MA_2min_lower;
def MA_2min_same;
def MA_2min_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.TWO_MIN {
    MA_2min_close = close(period="2 min");
    MA_2min_shortAvg = MovingAverage(MAtype, MA_2min_close, ShortAverage);
    MA_2min_longAvg = MovingAverage(MAtype,MA_2min_close, LongAverage);
    MA_2min_nowcrossing = if Crosses(MA_2min_shortAvg, MA_2min_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_2min_same = if MA_2min_nowcrossing == 1 then 1 else Double.NaN;
    if MA_2min_same == 1 {
        MA_2min_higher = Double.NaN;
        MA_2min_lower = Double.NaN;
    } else {
        MA_2min_higher = if MA_2min_shortAvg >= MA_2min_longAvg[1] then 1 else Double.NaN;
        MA_2min_lower = if MA_2min_shortAvg < MA_2min_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_2min_close = 0;
    MA_2min_shortAvg = 0;
    MA_2min_longAvg = 0;
    MA_2min_higher = Double.NaN;
    MA_2min_lower = Double.NaN;
    MA_2min_same = Double.NaN;
    MA_2min_nowcrossing = 0;
}
AddLabel(MA_2min_higher, "2m", Color.DARK_GREEN);
AddLabel(MA_2min_lower, "2m", Color.DARK_RED);
AddLabel(MA_2min_same, "2m", Color.WHITE);


def MA_1min_close;
def MA_1min_shortAvg;
def MA_1min_longAvg;
def MA_1min_higher;
def MA_1min_lower;
def MA_1min_same;
def MA_1min_nowcrossing;
if GetAggregationPeriod() == AggregationPeriod.MIN {
    MA_1min_close = close(period="1 min");
    MA_1min_shortAvg = MovingAverage(MAtype, MA_1min_close, ShortAverage);
    MA_1min_longAvg = MovingAverage(MAtype,MA_1min_close, LongAverage);
    MA_1min_nowcrossing = if Crosses(MA_1min_shortAvg, MA_1min_longAvg, CrossingDirection.ANY) then 1 else 0;
    MA_1min_same = if MA_1min_nowcrossing == 1 then 1 else Double.NaN;
    if MA_1min_same == 1 {
        MA_1min_higher = Double.NaN;
        MA_1min_lower = Double.NaN;
    } else {
        MA_1min_higher = if MA_1min_shortAvg >= MA_1min_longAvg[1] then 1 else Double.NaN;
        MA_1min_lower = if MA_1min_shortAvg < MA_1min_longAvg[1] then 1 else Double.NaN;
    }
} else {
    MA_1min_close = 0;
    MA_1min_shortAvg = 0;
    MA_1min_longAvg = 0;
    MA_1min_higher = Double.NaN;
    MA_1min_lower = Double.NaN;
    MA_1min_same = Double.NaN;
    MA_1min_nowcrossing = 0;
}
AddLabel(MA_1min_higher, "1m", Color.DARK_GREEN);
AddLabel(MA_1min_lower, "1m", Color.DARK_RED);
AddLabel(MA_1min_same, "1m", Color.WHITE);
 
Last edited by a moderator:
@Cindy The above label code has an input that can be changed to whatever aggregation you want. However, here is an example of multiple aggregation labels together. A limitation of combining aggregations in this way is that your chart aggregation must always be equal to or lower than the shortest aggregation label in order to see any of the labels.

To add additional aggregations, simply duplicate the method used.

Code:
def agg1 = aggregationperiod.five_min;
def agg2 = aggregationperiod.ten_min;
def agg3 = aggregationperiod.fifteen_min;
def agg4 = aggregationperiod.thirty_min;
def agg5 = aggregationperiod.hour;
def agg6 = aggregationperiod.day;
def agg7 = aggregationperiod.week;

def ma1 = expaverage(close(period = agg1), 5) > expaverage(close(period = agg1), 21);
def ma2 = expaverage(close(period = agg2), 5) > expaverage(close(period = agg2), 21);
def ma3 = expaverage(close(period = agg3), 5) > expaverage(close(period = agg3), 21);
def ma4 = expaverage(close(period = agg4), 5) > expaverage(close(period = agg4), 21);
def ma5 = expaverage(close(period = agg5), 5) > expaverage(close(period = agg5), 21);
def ma6 = expaverage(close(period = agg6), 5) > expaverage(close(period = agg6), 21);
def ma7 = expaverage(close(period = agg7), 5) > expaverage(close(period = agg7), 21);

AddLabel(1, " 5 ", if ma1 then color.green else color.red);
AddLabel(1, " 10 ", if ma2 then color.green else color.red);
AddLabel(1, " 15 ", if ma3 then color.green else color.red);
AddLabel(1, " 30 ", if ma4 then color.green else color.red);
AddLabel(1, " HR ", if ma5 then color.green else color.red);
AddLabel(1, " D ", if ma6 then color.green else color.red);
AddLabel(1, " W ", if ma7 then color.green else color.red);
labels.png
hello, how can additional EMA be added to this set up? rather than just 5/21 i use 5/8/21/34/55/89 D/4H/1H/15
 
Thanks for sharing your code! Made some changes to make it a bit more visually pleasing.


Code:
# Rate of Change
# cabe1332
#The Rate Of Change (ROC) is an oscillator calculating the percentage change of the security price relative to the price a specified number (length) of periods before. The higher the ROC, the more overbought the security; when the ROC falls, a rally might occur.

# 10/20/2021 Rev.1
# TOC ROC with labels

# 10/23/2021 Rev.2
# added support and condition for bulls and bears labels
# added RSI and EMA stacked for better entry/exit labels
# added support for Profit Taking conditions with labels


## code start

declare lower;

input length = 7;
input colorNormLength = 7;
input price = close;
input bullthreshold = 2;
input bearthreshold = -2;

Assert(length > 0, "'length' must be positive: " + length);

plot ROC = if price[length] != 0 then (price / price[length] - 1) * 100 else 0;
ROC.DefineColor("Highest", Color.GREEN);
ROC.DefineColor("Lowest", Color.RED);
ROC.AssignNormGradientColor(colorNormLength, ROC.Color("Lowest"), ROC.Color("Highest"));
ROC.SetLineWeight(2);

plot zeroline = if !IsNaN(close) then 0 else Double.NaN;
zeroline.AssignValueColor(if ROC > 0 then Color.GREEN else Color.LIGHT_RED);
zeroline.SetPaintingStrategy(PaintingStrategy.dashES);
zeroline.SetLineWeight(1);

# RSI
def rsi = RSI()."RSI" is greater than or equal to 30 and RSI()."RSI" is less than or equal to 70 within 2 bar;

#EMAstacked#
def BULLISHstackedUp = MovAvgExponential("length" = 8)."AvgExp" is greater than MovAvgExponential("length" = 21)."AvgExp"
and MovAvgExponential("length" = 21)."AvgExp" is greater than MovAvgExponential("length" = 34)."AvgExp"
and MovAvgExponential("length" = 34)."AvgExp" is greater than MovAvgExponential("length" = 50)."AvgExp" within 2 bars;

def BEARstackedUp = MovAvgExponential("length" = 8)."AvgExp" is less than MovAvgExponential("length" = 21)."AvgExp"
and MovAvgExponential("length" = 21)."AvgExp" is less than MovAvgExponential("length" = 34)."AvgExp"
and MovAvgExponential("length" = 34)."AvgExp" is less than MovAvgExponential("length" = 50)."AvgExp" within 2 bars;

# ROC increasing or decreasing label
AddLabel(yes, if ROC > ROC[1] then " ROC Increasing " + Round(ROC, 2) + " " else " ROC Decreasing " + Round(ROC, 2) + " ", if ROC > ROC[1] then Color.GREEN else Color.RED);

# BULLISH OR BULLISH OR NEUTRAL
AddLabel(yes, if ROC >= bullthreshold then " BULLISH " else if ROC <= bearthreshold then " BEARISH " else " Wait & Watch ", if ROC >= bullthreshold then Color.GREEN else if ROC <= bearthreshold then Color.RED else Color.WHITE);

# GOING LONG OR SHORT BUY
def LONGBUY = ROC >= bullthreshold and rsi and BULLISHstackedUp;
def SHORTBUY = ROC <= bearthreshold and rsi and BEARstackedUp;
AddLabel(yes, if LONGBUY then " BUY LONG " else if SHORTBUY then " Sell SHORT " else "", if LONGBUY then Color.GREEN else if SHORTBUY then Color.RED else Color.WHITE);

# PERSONAL MESSAGE TO TAKE PROFITS
def TakeProfit = (ROC between 10 and 20) or (ROC between -10 and -20);
def SeriouslyTakeProfit = (ROC between 21 and 50) or (ROC between -21 and -50);
def FinTakeProfit = (ROC between 51 and 99) or (ROC between -51 and -99);
def DontBeLoser = (ROC >= 100) or (ROC <= -100);
AddLabel(yes, if TakeProfit then " Take Profit! " else if SeriouslyTakeProfit then " SERIOUSLY, Take Profit! " else if FinTakeProfit then " ****IN! Take Profit! " else if DontBeLoser then " DON'T BE A LOSER! Take Profit! " else "", if TakeProfit then Color.GREEN else if SeriouslyTakeProfit then Color.CYAN else if FinTakeProfit then Color.ORANGE else if DontBeLoser then Color.MAGENTA else Color.BLACK);

DefineGlobalColor("Bullish", Color.cyan);
DefineGlobalColor("Bearish", Color.pink);
AddCloud(ROC, zeroline , globalColor("Bullish"), globalColor("Bearish"));
## end code
Can you please share your EMA's. Thanks
 
hello, how can additional EMA be added to this set up? rather than just 5/21 i use 5/8/21/34/55/89 D/4H/1H/15
(As per the first code) Simply replace each ma line (i.e ma1, ma2 etc.) with this code below. Also, do the inverse (instead of > do <) for ma1b, ma2b etc.

Ruby:
def ma1 = expaverage(close(period = agg1), 5) > expaverage(close(period = agg1), 8) and expaverage(close(period = agg1), 8) > expaverage(close(period = agg1), 21) and expaverage(close(period = agg1), 21) > expaverage(close(period = agg1), 34) and expaverage(close(period = agg1), 34) > expaverage(close(period = agg1), 55) and
expaverage(close(period = agg1), 55) > expaverage(close(period = agg1), 89);
 
I would like a add a drop down color menu to adjust the color of the cloud in the cloud ripster study if possible. I have been trying different things without success. I would like to select the color of the cloud like you select the color of a trend line. here is the code of the study it has pink and cyan baked into the code. help would be appreciated. -Wes

Ruby:
input price = close;#hint price: The price used to calculate the crossover. <b>(Default is CLOSE)</b>
input fastLength = 8;#hint fastLength: The number of bars used to calculate the fast moving average. <b>(Default is 3)</b>
input slowLength = 21;#hint slowLength: The number of bars used to calculate the slow moving average. <b>(Default is 8)</b>
input slowAvgType = {default Simple, Exponential, Weighted, Wilders, Hull};#hint slowAvgType: Type of the fast moving average to be used for calculation. <b>(Default is Expontential)</b>
input fastAvgType = {default Simple, Exponential, Weighted, Wilders, Hull};#hint fastAvgType: Type of the fast moving average to be used for calculation. <b>(Default is Exponential)</b>
Input DoArrows = no;#hint DoArrows:Yes shows arrows to define crosses
Input DoPlots = yes;#hint DoPlots: Yes shows MA plots to define crosses. Default is 'YES'
Input DoAlerts = No;#hint DoAlerts:No turns off alerts
Assert( fastLength < slowLength, "fastLength ["+fastLength+"] must be less than slowLength["+slowLength+"]");

def fastAvg;
switch (slowAvgType) {
case Simple:
fastAvg = Average(price, fastLength);
case Exponential:
fastAvg = ExpAverage(price, fastLength);
case Weighted:
fastAvg = wma(price, fastLength);
case Wilders:
fastAvg = WildersAverage(price, fastLength);
case Hull:
fastAvg = HullMovingAvg(price, fastLength);
}

def slowAvg;
switch (fastAvgType) {
case Simple:
slowAvg = Average(price, slowLength);
case Exponential:
slowAvg = ExpAverage(price, slowLength);
case Weighted:
slowAvg = wma(price, slowLength);
case Wilders:
slowAvg = WildersAverage(price, slowLength);
case Hull:
slowAvg = HullMovingAvg(price, slowLength);
}

plot signalXup = If DoArrows Then crosses(fastAvg, slowAvg, CrossingDirection.above) else Double.nan;
signalXup.SetDefaultColor(Color.pink);
signalXup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
signalXup.SetLineWeight(3);

plot signalXdn = If DoArrows Then crosses(fastAvg, slowAvg, CrossingDirection.below) else Double.nan;
signalXdn.SetDefaultColor(Color.Green);
signalXdn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
signalXdn.SetLineWeight(3);


Plot fast_Avg = If DoPlots then Fastavg else double.nan;
fast_Avg.SetDefaultColor(Color.pink);
fast_Avg.SetPaintingStrategy(PaintingStrategy.line);
fast_Avg.SetLineWeight(2);
Plot Slo_Avg = If DoPlots then Slowavg else double.nan;
Slo_Avg.SetDefaultColor(Color.cyan);
Slo_Avg.SetPaintingStrategy(PaintingStrategy.line);
Slo_Avg.SetLineWeight(2);
AddCloud(fastAvg, slowAvg, color.cyan, color.pink);
#AddLabel(1, "Fast MA(" + fastLength + ")",color.pink);
#AddLabel(1, "Slow MA(" + slowLength + ")",color.cyan);

#Trigger alerts
#alert(Fastavg, "CHECK IT OUT", Alert.Bar, Sound.Ding);
 
Last edited by a moderator:
Use global colors:
Code:
DefineGlobalColor("UpColor", Color.CYAN);
DefineGlobalColor("DnColor", Color.PINK);
AddCloud(fastAvg, slowAvg, GlobalColor("UpColor"), GlobalColor("DnColor"));
Then you can go to the "globals" section and edit them to your heart's content (even transparency!!!)

-mashume
 
Use global colors:
Code:
DefineGlobalColor("UpColor", Color.CYAN);
DefineGlobalColor("DnColor", Color.PINK);
AddCloud(fastAvg, slowAvg, GlobalColor("UpColor"), GlobalColor("DnColor"));
Then you can go to the "globals" section and edit them to your heart's content (even transparency!!!)

-mashume
Thankyou it is just what i was looking for - Wes
 
Any one help converting the below trading view code please
//@version=5
indicator("Ripster Multi Time Frame Clouds", shorttitle="Ripster MTF Clouds", overlay=true)
 
Last edited by a moderator:
here you go @FellowTrader :

RIPSTER47 (RIPSTER) Multi Time Frame EMA Cloud
Code:
input price = close;
input displace = 0;
input length1 = 50;
input length2 = 55;
input length3 = 20;
input length4 = 21;
input period = AggregationPeriod.DAY;
input averageType = AverageType.Exponential;

def MA1 = MovingAverage(averageType, close(period = period) [-displace], length = length1);
def MA2 = MovingAverage(averageType, close(period = period) [-displace], length = length2);
def MA3 = MovingAverage(averageType, close(period = period) [-displace], length = length3);
def MA4 = MovingAverage(averageType, close(period = period) [-displace], length = length4);

#AddCloud(ma1,ma2, (CreateColor(255, 240, 0)));
#AddCloud(ma3,ma4, (CreateColor(100, 240, 0)));
addcloud(ma1,ma2, color.yellow, color.dark_orange);
addcloud(ma3,ma4, color.green, color.red);
 
Last edited:
Use global colors:
Code:
DefineGlobalColor("UpColor", Color.CYAN);
DefineGlobalColor("DnColor", Color.PINK);
AddCloud(fastAvg, slowAvg, GlobalColor("UpColor"), GlobalColor("DnColor"));
Then you can go to the "globals" section and edit them to your heart's content (even transparency!!!)

-mashume
Do you replace anything in the code or just add to it ? I don’t know how to code but I’m going to figure this out
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
381 Online
Create Post

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