Is it possible to plot a Triple Supertrend as a red dot/ green dot ribbon as a lower indicator?

lovetotrade

New member
Platform
  1. Thinkorswim
I want to be able to track 3 different Supertrends with 3 different settings!!!!! thanks in advance.
 

barbaros

Administrator
Staff member
Is it like this one?

 
@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

R9g2jqK.png


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.
 

lovetotrade

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

R9g2jqK.png


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.
yes like this>..... this is perfect like this ribbon on lower study
 

barbaros

Administrator
Staff member
Something like this?

Code:
# 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
 
@barbaros - any chance for a scanner for when the first bar triggers from green to red and vice versa. Meaning the top level bar. The best would be a scanner that could scan for any of the 3 supertrend signal changes, i.e any of the 3 levels. Thanks in advance if you can help. Hopefully I described this well enough
 
@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.
 
Last edited:

lovetotrade

New member
@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.
@hockeydoug Great!! thanks for the information.. we still working on this project!!
 
Top