Looking for Triple Supertrend Indicator scanner on 15m timeframe

chackiejan

New member
I'd like to create a scanner that scans sp500 stocks where these three indicators are met on 15m timeframe for intraday trading. I'm new to TOS

1. ATR 10 HL2 MP 1
2. ATR 11 HL2 MP 2
3. ATR 12 HL2 MP 3
 
Solution
The ToS platform finds most Supertrend studies too complex to be used in the Stock Scan Hacker
Which would mean THREE Supertrend studies would not be possible.

hockeycoachdoug

Active member
2019 Donor
VIP
I am looking for something similar to this. I want to scan for a triple supertrend occurance where all 3 Supertrends are now the same color using the setting from the OP post
1. ATR 10 HL2 MP 1
2. ATR 11 HL2 MP 2
3. ATR 12 HL2 MP 3
I want to add a 200 EMA also. It would be great if all the supertrend values could be changed but the defaults are the ones shown. Same for the EMA so that it could be changed to different types of MA such as HULL and the length could be changed, but default at 200. Here is YT video discussing this method YT Video here
It would be nice to have an all in one indicator and a scan that could be used with it. Thanks in advance for any help
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
The ToS platform finds most Supertrend studies too complex to be used in the Stock Scan Hacker
Which would mean THREE Supertrend studies would not be possible.
 
Solution

king_louie

Member
VIP
I'd like to create a scanner that scans sp500 stocks where these three indicators are met on 15m timeframe for intraday trading. I'm new to TOS

1. ATR 10 HL2 MP 1
2. ATR 11 HL2 MP 2
3. ATR 12 HL2 MP 3
If you set Supertrend to cross below price for bullish signal and Supertrend to cross above price for bearish signal should work. The only issue would be that you would have to wait for the candle to close to confirm signal from the scan. Hope this helps!
 
Last edited:

hockeycoachdoug

Active member
2019 Donor
VIP
Is it possible to plot this Triple Supertrend as a red dot/ green dot ribbon as a lower indicator so it might look like this
EMGYWcV.png


I want to be able to track 3 different Supertrends with 3 different settings
 

samer800

New member
I Hope someone of the group can help!! this is look very good idea.
not the best coding. pls verify :)

# 3 + Super Trend
# 06/2022
#3 Super Trend - Mod by SAM4COK


declare lower;

input ATR1 = 1.0; # Between 1 - 100
input Period1 = 10; #Between 1 - 100
input ATR2 = 2.0; # Between 1 - 100
input Period2 = 11; #Between 1 - 100
input ATR3 = 3.0; # Between 1 - 100
input Period3 = 12; #Between 1 - 100
input changeATR = no;
input ShowLabel = yes;
input AvgType = AverageType.SIMPLE;

Assert(ATR1 > 0 and ATR2 > 0 and ATR3 > 0, "'atr factor' must be positive");

def Agg = GetAggregationPeriod();

def closePrice = close(period = Agg);
def highPrice = high(period = Agg);
def lowPrice = low(period = Agg);
def PriceST = hl2(period = Agg);
def Na = Double.NaN;

def iATR1 = if changeATR then ATR(Period1) else MovingAverage(AvgType, Max(Max(highPrice - lowPrice, AbsValue(highPrice - closePrice[1])), AbsValue(lowPrice - closePrice[1])), Period1);
def iATR2 = if changeATR then ATR(Period2) else MovingAverage(AvgType, Max(Max(highPrice - lowPrice, AbsValue(highPrice - closePrice[1])), AbsValue(lowPrice - closePrice[1])), Period2);
def iATR3 = if changeATR then ATR(Period3) else MovingAverage(AvgType, Max(Max(highPrice - lowPrice, AbsValue(highPrice - closePrice[1])), AbsValue(lowPrice - closePrice[1])), Period3);

def UP_Band_Basic1 = PriceST + (ATR1 * iATR1);
def LW_Band_Basic1 = PriceST - (ATR1 * iATR1);
def UP_Band_Basic2 = PriceST + (ATR2 * iATR2);
def LW_Band_Basic2 = PriceST - (ATR2 * iATR2);
def UP_Band_Basic3 = PriceST + (ATR3 * iATR3);
def LW_Band_Basic3 = PriceST - (ATR3 * iATR3);

def UP_Band1 = if ((UP_Band_Basic1 < UP_Band1[1]) or (closePrice[1] > UP_Band1[1])) then UP_Band_Basic1 else UP_Band1[1];
def LW_Band1 = if ((LW_Band_Basic1 > LW_Band1[1]) or (closePrice[1] < LW_Band1[1])) then LW_Band_Basic1 else LW_Band1[1];

def UP_Band2 = if ((UP_Band_Basic2 < UP_Band2[1]) or (closePrice[1] > UP_Band2[1])) then UP_Band_Basic2 else UP_Band2[1];
def LW_Band2 = if ((LW_Band_Basic2 > LW_Band2[1]) or (closePrice[1] < LW_Band2[1])) then LW_Band_Basic2 else LW_Band2[1];

def UP_Band3 = if ((UP_Band_Basic3 < UP_Band3[1]) or (closePrice[1] > UP_Band3[1])) then UP_Band_Basic3 else UP_Band3[1];
def LW_Band3 = if ((LW_Band_Basic3 > LW_Band3[1]) or (closePrice[1] < LW_Band3[1])) then LW_Band_Basic3 else LW_Band3[1];


def ST1 = if ((ST1[1] == UP_Band1[1]) and (closePrice < UP_Band1)) then UP_Band1 else
if ((ST1[1] == UP_Band1[1]) and (closePrice > UP_Band1)) then LW_Band1 else
if ((ST1[1] == LW_Band1[1]) and (closePrice > LW_Band1)) then LW_Band1 else
if ((ST1[1] == LW_Band1) and (closePrice < LW_Band1)) then UP_Band1 else LW_Band1;

def ST2 = if ((ST2[1] == UP_Band2[1]) and (closePrice < UP_Band2)) then UP_Band2 else
if ((ST2[1] == UP_Band2[1]) and (closePrice > UP_Band2)) then LW_Band2 else
if ((ST2[1] == LW_Band2[1]) and (closePrice > LW_Band2)) then LW_Band2 else
if ((ST2[1] == LW_Band2) and (closePrice < LW_Band2)) then UP_Band2 else LW_Band2;

def ST3 = if ((ST3[1] == UP_Band3[1]) and (closePrice < UP_Band3)) then UP_Band3 else
if ((ST3[1] == UP_Band3[1]) and (closePrice > UP_Band3)) then LW_Band3 else
if ((ST3[1] == LW_Band3[1]) and (closePrice > LW_Band3)) then LW_Band3 else
if ((ST3[1] == LW_Band3) and (closePrice < LW_Band3)) then UP_Band3 else LW_Band3;

Plot Long1 = if closePrice > ST1 then 1 else 0;
long1.SetPaintingStrategy(PaintingStrategy.POINTS);
Long1.AssignValueColor(if Long1 == 0 then color.black else CreateColor(100, 181, 246));
long1.SetLineWeight(1);
Plot Short1 = if closePrice < ST1 then 1 else 0;
Short1.SetPaintingStrategy(PaintingStrategy.POINTS);
short1.AssignValueColor(if short1 == 0 then color.black else CreateColor(239, 83, 80));
Short1.SetLineWeight(1);

Plot Long2 = if closePrice > ST2 then 2 else 0;
long2.SetPaintingStrategy(PaintingStrategy.POINTS);
Long2.AssignValueColor(if Long2 == 0 then color.black else CreateColor(100, 181, 246));
long2.SetLineWeight(1);
Plot Short2 = if closePrice < ST2 then 2 else 0;
Short2.SetPaintingStrategy(PaintingStrategy.POINTS);
short2.AssignValueColor(if short2 == 0 then color.black else CreateColor(239, 83, 80));
Short2.SetLineWeight(1);

Plot Long3 = if closePrice > ST3 then 3 else 0;
long3.SetPaintingStrategy(PaintingStrategy.POINTS);
Long3.AssignValueColor(if Long3 == 0 then color.black else CreateColor(100, 181, 246));
long3.SetLineWeight(1);
Plot Short3 = if closePrice < ST3 then 3 else 0;
Short3.SetPaintingStrategy(PaintingStrategy.POINTS);
short3.AssignValueColor(if short3 == 0 then color.black else CreateColor(239, 83, 80));
Short3.SetLineWeight(1);

Plot trendUP = if (Long1 + long2 + long3) > 1 then 4 else Na;
Plot trendDN = if (Short1 + Short2 + Short3) > 1 then 4 else Na;

trendUP.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
trendUP.AssignValueColor(if long1 > 0 and long2 > 0 and long3 > 0 then color.GREEN else color.orange);
trendUP.SetLineWeight(1);
trendDN.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
trendDN.AssignValueColor(if short1 > 0 and short2 > 0 and short3 > 0 then color.RED else color.orange);
trendDN.SetLineWeight(1);

addlabel (ShowLabel, "Trend", if long1 > 0 and long2 > 0 and long3 > 0 then color.GREEN else if short1 > 0 and short2 > 0 and short3 > 0 then color.RED else color.orange);
 

samer800

New member
I am looking for something similar to this. I want to scan for a triple supertrend occurance where all 3 Supertrends are now the same color using the setting from the OP post
1. ATR 10 HL2 MP 1
2. ATR 11 HL2 MP 2
3. ATR 12 HL2 MP 3
I want to add a 200 EMA also. It would be great if all the supertrend values could be changed but the defaults are the ones shown. Same for the EMA so that it could be changed to different types of MA such as HULL and the length could be changed, but default at 200. Here is YT video discussing this method YT Video here
It would be nice to have an all in one indicator and a scan that could be used with it. Thanks in advance for any help
paste the below in the scanner. Change change the # for uptrend or down trend.

# 3 + Super Trend Scan
# 06/2022
#3 Super Trend - Mod by SAM4COK

declare lower;

input ATR1 = 1.0; # Between 1 - 100
input Period1 = 10; #Between 1 - 100
input ATR2 = 2.0; # Between 1 - 100
input Period2 = 11; #Between 1 - 100
input ATR3 = 3.0; # Between 1 - 100
input Period3 = 12; #Between 1 - 100

input AvgType = AverageType.SIMPLE;


def Na = Double.NaN;

def iATR1 = ATR(Period1);
def iATR2 = ATR(Period2);
def iATR3 = ATR(Period3);

def UP_Band_Basic1 = hl2 + (ATR1 * iATR1);
def LW_Band_Basic1 = hl2 - (ATR1 * iATR1);

def UP_Band_Basic2 = hl2 + (ATR2 * iATR2);
def LW_Band_Basic2 = hl2 - (ATR2 * iATR2);

def UP_Band_Basic3 = hl2 + (ATR3 * iATR3);
def LW_Band_Basic3 = hl2 - (ATR3 * iATR3);

def UP_Band1 = if ((UP_Band_Basic1 < UP_Band1[1]) or (close[1] > UP_Band1[1])) then UP_Band_Basic1 else UP_Band1[1];
def LW_Band1 = if ((LW_Band_Basic1 > LW_Band1[1]) or (close[1] < LW_Band1[1])) then LW_Band_Basic1 else LW_Band1[1];

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 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 ST1 = if ((ST1[1] == UP_Band1[1]) and (close < UP_Band1)) then UP_Band1 else
if ((ST1[1] == UP_Band1[1]) and (close > UP_Band1)) then LW_Band1 else
if ((ST1[1] == LW_Band1[1]) and (close > LW_Band1)) then LW_Band1 else
if ((ST1[1] == LW_Band1) and (close < LW_Band1)) then UP_Band1 else LW_Band1;

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;

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;

def Long1 = if close > ST1 then 1 else 0;
def Short1 = if close < ST1 then 1 else 0;

def Long2 = if close > ST2 then 1 else 0;
def Short2 = if close < ST2 then 1 else 0;

def Long3 = if close > ST3 then 1 else 0;
def Short3 = if close < ST3 then 1 else 0;

def Long = if (Long1 + long2 + long3) == 3 then 1 else na;
def Short = if (Short1 + Short2 + Short3) == 3 then 1 else na ;

Plot trendUP = Long;
#Plot trendDN = Short;
 

eka

New member
Complete newbie to coding, so please bear with my questions:
(1) What do the 3 time periods 10, 11, and 12 mean?
(2) Is period 1 the most sensitive?
(3) Can this indicator placed on any timeframe?
Thanks
 

samer800

New member
Complete newbie to coding, so please bear with my questions:
(1) What do the 3 time periods 10, 11, and 12 mean? Number of backward bars used for calculation .
(2) Is period 1 the most sensitive? Depends on the inputs. lowers inputs usually more sensitive to recent price action.
(3) Can this indicator placed on any timeframe? yes.
Thanks

I am not expert either but hope above answer you.
 

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.
Top