Supertrend with 2 timeframes

PAYtience

New member
VIP
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
 
Last edited by a moderator:

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

Thread starter Similar threads Forum Replies Date
N Looking For SuperTrend Questions 1
rvaidyamath TTM with SuperTrend Questions 0
F SuperTrend RSI Strategy Help Questions 1
M Supertrend indicator Questions 3
M SuperTrend + RSI Trigger Questions 3

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
389 Online
Create Post

Similar threads

Similar threads

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