petergluis
Active member
I convert Multi Bollinger Heat Bands for ThinkorSwim.
https://www.tradingview.com/script/jt8pw1gr-JR-Multi-Bollinger-Heat-Bands-EMA-Breakout-options/
I am wondering why following two codes are not working since the indicator shows two red clouds instead of pink and yellow clouds.
AddCloud(ubi, ubm, color.pink);
AddCloud (ubm, ubo, color.yellow);
https://www.tradingview.com/script/jt8pw1gr-JR-Multi-Bollinger-Heat-Bands-EMA-Breakout-options/
I am wondering why following two codes are not working since the indicator shows two red clouds instead of pink and yellow clouds.
AddCloud(ubi, ubm, color.pink);
AddCloud (ubm, ubo, color.yellow);
Ruby:
def bb_use_ema = no;
def bb_length = 20;
def bb_source = close;
def bb_mult = 2.0;
def bb_mult_inc = 0.5;
input averageType = AverageType.EXPONENTIAL;
input averageType1 = AverageType.SIMPLE;
def break_mult = 2.7;
def breakhigh_source = high;
def breaklow_source = low;
def bb_basis = if bb_use_ema then MovingAverage(averageType, bb_source, bb_length) else MovingAverage(averageType1, bb_source, bb_length);
def dev = StDev(bb_source, bb_length);
def bb_dev_inner = bb_mult * dev;
def bb_dev_mid = (bb_mult + bb_mult_inc) * dev;
def bb_dev_outer = (bb_mult + (bb_mult_inc * 2)) * dev;
def break_dev = break_mult * dev;
def inner_high = bb_basis + bb_dev_inner;
def mid_high = bb_basis + bb_dev_mid;
def outer_high = bb_basis + bb_dev_outer;
def inner_low = bb_basis - bb_dev_inner;
def mid_low = bb_basis - bb_dev_mid;
def outer_low = bb_basis - bb_dev_outer;
def break_high = bb_basis + break_dev;
def break_low = bb_basis - break_dev;
plot Basis_Line = bb_basis;
plot ubi = inner_high;
plot ubm = mid_high;
plot ubo = outer_high;
AddCloud(ubi, ubm, color.pink);
AddCloud (ubm, ubo, color.yellow);
plot lbi = inner_low;
plot lbm = mid_low;
plot lbo = outer_low;
AddCloud (lbi, lbm, Color.light_GREEN);
AddCloud (lbm, lbo, Color.GREEN);
AddCloud(ubi, lbi, Color.CYAN);