lovetotrade
Member
- Platform
-
- Thinkorswim
I want to be able to track 3 different Supertrends with 3 different settings!!!!! thanks in advance.
yes like this>..... this is perfect like this ribbon on lower study@barbaros- yes, sort of. The triple Supertrend part is all I am looking for to plot as a lower indicator in a ribbon format like this
![]()
I would like to be able to change all the variables on all 3 supertrends like the upper indicator allows only plot as a ribbon as a lower indicator.
# SuperTrend Yahoo Finance Replica - Modified from Modius SuperTrend
# Modified Modius ver. by RConner7
# Modified by Barbaros to replicate look from TradingView version
# Modified by Barbaros to add EMA cross for bubbles and alerts
# Modified by Barbaros to update bar color painting
# v3.3
# Modified by Fluideng to make the triple SuplerTrend into one indicator. Also removed EMA2 and Bar color.
# Modified by Barbaros to show as a lower indicator, removed EMA and others
declare lower;
### SuperTrend #1
input AtrMult = 3.00;
input nATR = 12;
input AvgType = AverageType.HULL;
def ATR = ATR("length" = nATR, "average type" = AvgType);
def UP_Band_Basic = HL2 + (AtrMult * ATR);
def LW_Band_Basic = HL2 + (-AtrMult * ATR);
def UP_Band = if ((UP_Band_Basic < UP_Band[1]) or (close[1] > UP_Band[1])) then UP_Band_Basic else UP_Band[1];
def LW_Band = if ((LW_Band_Basic > LW_Band[1]) or (close[1] < LW_Band[1])) then LW_Band_Basic else LW_Band[1];
def ST = if ((ST[1] == UP_Band[1]) and (close < UP_Band)) then UP_Band
else if ((ST[1] == UP_Band[1]) and (close > Up_Band)) then LW_Band
else if ((ST[1] == LW_Band[1]) and (close > LW_Band)) then LW_Band
else if ((ST[1] == LW_Band) and (close < LW_Band)) then UP_Band
else LW_Band;
plot SuperTrend1 = if isNaN(close) then Double.NaN else 1;
SuperTrend1.SetPaintingStrategy(PaintingStrategy.POINTS);
SuperTrend1.SetLineWeight(3);
SuperTrend1.AssignValueColor(if close > ST then Color.GREEN else if close < ST then Color.RED else Color.GRAY);
### SuperTrend #2
input AtrMult2 = 2.00;
input nATR2 = 11;
def ATR2 = ATR("length" = nATR2, "average type" = AvgType);
def UP_Band_Basic2 = HL2 + (AtrMult2 * ATR);
def LW_Band_Basic2 = HL2 + (-AtrMult2 * ATR);
def UP_Band2 = if ((UP_Band_Basic2 < UP_Band2[1]) or (close[1] > UP_Band2[1])) then UP_Band_Basic2 else UP_Band2[1];
def LW_Band2 = if ((LW_Band_Basic2 > LW_Band2[1]) or (close[1] < LW_Band2[1])) then LW_Band_Basic2 else LW_Band2[1];
def ST2 = if ((ST2[1] == UP_Band2[1]) and (close < UP_Band2)) then UP_Band2
else if ((ST2[1] == UP_Band2[1]) and (close > Up_Band2)) then LW_Band2
else if ((ST2[1] == LW_Band2[1]) and (close > LW_Band2)) then LW_Band2
else if ((ST2[1] == LW_Band2) and (close < LW_Band2)) then UP_Band2
else LW_Band2;
plot SuperTrend2 = if isNaN(close) then Double.NaN else 2;
SuperTrend2.SetPaintingStrategy(PaintingStrategy.POINTS);
SuperTrend2.SetLineWeight(3);
SuperTrend2.AssignValueColor(if close > ST2 then Color.GREEN else if close < ST2 then Color.RED else Color.GRAY);
### SuperTrend #3
input AtrMult3 = 1.00;
input nATR3 = 10;
def ATR3 = ATR("length" = nATR3, "average type" = AvgType);
def UP_Band_Basic3 = HL2 + (AtrMult3 * ATR);
def LW_Band_Basic3 = HL2 + (-AtrMult3 * ATR);
def UP_Band3 = if ((UP_Band_Basic3 < UP_Band3[1]) or (close[1] > UP_Band3[1])) then UP_Band_Basic3 else UP_Band3[1];
def LW_Band3 = if ((LW_Band_Basic3 > LW_Band3[1]) or (close[1] < LW_Band3[1])) then LW_Band_Basic3 else LW_Band3[1];
def ST3 = if ((ST3[1] == UP_Band3[1]) and (close < UP_Band3)) then UP_Band3
else if ((ST3[1] == UP_Band3[1]) and (close > Up_Band3)) then LW_Band3
else if ((ST3[1] == LW_Band3[1]) and (close > LW_Band3)) then LW_Band3
else if ((ST3[1] == LW_Band3) and (close < LW_Band3)) then UP_Band3
else LW_Band3;
plot SuperTrend3 = if isNaN(close) then Double.NaN else 3;
SuperTrend3.SetPaintingStrategy(PaintingStrategy.POINTS);
SuperTrend3.SetLineWeight(3);
SuperTrend3.AssignValueColor(if close > ST3 then Color.GREEN else if close < ST3 then Color.RED else Color.GRAY);
# End Code SuperTrend Yahoo Finance Replica
hey @hockeydoug do you know the setting they are using? thank you in advanceFirst glance looks good. Thank you @barbaros . Once again, a TOS coding hero. Great work.
great!! thanks @hockeydoug .. let try itI watched the webinar again today. I think the length is 5, multipliers maybe 2, 1.5, 1 or 3,2,1. Not sure at this time. What are your thoughts?
thank you @hockeydoug .. we going to get there hopelly..@lovetotrade -
I haven't got them to match up yet. Must be more to it . Here is what was shown
![]()
And this
![]()
@hockeydoug Great!! thanks for the information.. we still working on this project!!@lovetotrade - I don't know what settings they are using, but the default 3-12 ,2-11, 1-10 seem to work fine. Just follow the "gear shift" down each level as it triggers. Concept seems to work just fine. Prolly need something more reactive then the defaults to get the quick trigger in on the shortest time frame. One of the possibile reasons to not match up could be the selection of the type of moving average they use. Thoughts welcome.