Is there a way to combine 2 SuperTrend timeframes, I tried -
Original Supertrend: https://usethinkscript.com/threads/supertrend-indicator-by-mobius-for-thinkorswim.7/
##################################
# Mobius
# SuperTrend
# Chat Room Request
# V03.10.2015
# Added Bubbles to mark entry and exit prices. Doesn't give much time to follow into trade, but better than guessing.
# Altered default settings for values that made more sense on Intraday Futures. Added Color and ColorBars.
#Hint:Supertrend Indicator: shows trend direction and gives buy or sell signals according to that. It is based on a combination of the average price rate in the current period along with a volatility indicator. The ATR indicator is most commonly used as volatility indicator. The values are calculated as follows:
# Up = (HIGH + LOW) / 2 + Multiplier * ATR
# Down = (HIGH + LOW) / 2 – Multiplier * ATR
# When the change of trend occurs, the indicator flips
input AtrMult = 1.0;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = yes; #changed to no 9-20-2023
input ShowLabels = yes;
input fast = AggregationPeriod.TWO_MIN;
def H_F = high(period=fast);
def C_F = close(period=fast);
def L_F = low(period=fast);
def ATR_F = MovingAverage(AvgType, TrueRange(H_F, C_F, L_F), nATR);
def UP_F = HL2 + (AtrMult * ATR_F);
def DN_F = HL2 + (-AtrMult * ATR_F);
def ST_F = if close < ST_F[1] then UP_F else DN_F;
def FAST_COLOR = if close < ST_F then 1 else 0;
input slow = AggregationPeriod.FIVE_MIN;
def H_S = high(period=slow);
def C_S = close(period=slow);
def L_S = low(period=slow);
def ATR_S = MovingAverage(AvgType, TrueRange(H_S, C_S, L_S), nATR);
def UP_S = HL2 + (AtrMult * ATR_S);
def DN_S = HL2 + (-AtrMult * ATR_S);
def ST_S = if close < ST_S[1] then UP_S else DN_S;
def SLOW_COLOR = if close < ST_S then 1 else 0;
def FINAL_COLOR = if SLOW_COLOR == 1 and FAST_COLOR == 1 then 11
else if SLOW_COLOR == 0 and FAST_COLOR == 0 then 00
else 22;
plot SuperTrend = FINAL_COLOR;
SuperTrend.AssignValueColor(if FINAL_COLOR == 11 then Color.RED
else if FINAL_COLOR == 00 then Color.GREEN
else Color.CYAN);
AssignPriceColor(if PaintBars and FINAL_COLOR == 11
then Color.RED
else if PaintBars and FINAL_COLOR == 00
then Color.GREEN
else Color.CYAN);
#AddLabel(showLabels, "SEQ", Color.YELLOW);
#AddLabel(close crosses below ST, low[1], low[1], color.Dark_Gray);
AddLabel (ShowLabels,"",(if close > ST_F then Color.GREEN else if close < ST_F then Color.RED else Color.GRAY));
#AddChartBubble(close crosses below ST, low[1], low[1], color.Dark_Gray);
#AddChartBubble(close crosses above ST, high[1], high[1], color.Dark_Gray, no);
# End Code SuperTrend
Original Supertrend: https://usethinkscript.com/threads/supertrend-indicator-by-mobius-for-thinkorswim.7/
##################################
# Mobius
# SuperTrend
# Chat Room Request
# V03.10.2015
# Added Bubbles to mark entry and exit prices. Doesn't give much time to follow into trade, but better than guessing.
# Altered default settings for values that made more sense on Intraday Futures. Added Color and ColorBars.
#Hint:Supertrend Indicator: shows trend direction and gives buy or sell signals according to that. It is based on a combination of the average price rate in the current period along with a volatility indicator. The ATR indicator is most commonly used as volatility indicator. The values are calculated as follows:
# Up = (HIGH + LOW) / 2 + Multiplier * ATR
# Down = (HIGH + LOW) / 2 – Multiplier * ATR
# When the change of trend occurs, the indicator flips
input AtrMult = 1.0;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = yes; #changed to no 9-20-2023
input ShowLabels = yes;
input fast = AggregationPeriod.TWO_MIN;
def H_F = high(period=fast);
def C_F = close(period=fast);
def L_F = low(period=fast);
def ATR_F = MovingAverage(AvgType, TrueRange(H_F, C_F, L_F), nATR);
def UP_F = HL2 + (AtrMult * ATR_F);
def DN_F = HL2 + (-AtrMult * ATR_F);
def ST_F = if close < ST_F[1] then UP_F else DN_F;
def FAST_COLOR = if close < ST_F then 1 else 0;
input slow = AggregationPeriod.FIVE_MIN;
def H_S = high(period=slow);
def C_S = close(period=slow);
def L_S = low(period=slow);
def ATR_S = MovingAverage(AvgType, TrueRange(H_S, C_S, L_S), nATR);
def UP_S = HL2 + (AtrMult * ATR_S);
def DN_S = HL2 + (-AtrMult * ATR_S);
def ST_S = if close < ST_S[1] then UP_S else DN_S;
def SLOW_COLOR = if close < ST_S then 1 else 0;
def FINAL_COLOR = if SLOW_COLOR == 1 and FAST_COLOR == 1 then 11
else if SLOW_COLOR == 0 and FAST_COLOR == 0 then 00
else 22;
plot SuperTrend = FINAL_COLOR;
SuperTrend.AssignValueColor(if FINAL_COLOR == 11 then Color.RED
else if FINAL_COLOR == 00 then Color.GREEN
else Color.CYAN);
AssignPriceColor(if PaintBars and FINAL_COLOR == 11
then Color.RED
else if PaintBars and FINAL_COLOR == 00
then Color.GREEN
else Color.CYAN);
#AddLabel(showLabels, "SEQ", Color.YELLOW);
#AddLabel(close crosses below ST, low[1], low[1], color.Dark_Gray);
AddLabel (ShowLabels,"",(if close > ST_F then Color.GREEN else if close < ST_F then Color.RED else Color.GRAY));
#AddChartBubble(close crosses below ST, low[1], low[1], color.Dark_Gray);
#AddChartBubble(close crosses above ST, high[1], high[1], color.Dark_Gray, no);
# End Code SuperTrend
Last edited by a moderator: