SuperTrend Yahoo Finance Type for ThinkorSwim

RConner7

Member
I've created the popular SuperTrend indicator that works and displays very similar to how the Yahoo Finance SuperTrend works. This was modified from the version that Modius originally created.

Suepr-Trend1.jpg


Painted bars:
Suepr-Trend2.jpg


Yahoo Finance version
Suepr-Trend-YF.jpg


Code:
# SuperTrend Yahoo Finance Replica - Modified from Modius SuperTrend
# Modified Modius ver. by RConner7

# Works similar to how Yahoo Finance Supertrend works and displays. Holds supertrend value until cross.

input AtrMult = 1.00;
input nATR = 6;
input AvgType = AverageType.HULL;
input PaintBars = yes;

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 SuperTrend = ST;
SuperTrend.AssignValueColor(if close < ST then Color.RED else Color.GREEN);
AssignPriceColor(if PaintBars and close < ST

                then Color.RED

               else if PaintBars and close > ST

                    then Color.GREEN

                     else Color.CURRENT);

plot ArrowDown = Supertrend crosses above close;
ArrowDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDown.SetDefaultColor(Color.RED);
ArrowDown.SetLineWeight(3);

plot ArrowUp = Supertrend crosses below close;
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowUp.SetDefaultColor(Color.GREEN);
ArrowUp.SetLineWeight(3);

# End Code SuperTrend Yahoo Finance Replica
 
Last edited:
Can someone help ? Looking to make a scanner in TOS for the Yahoo Supertrend code.
 
Last edited by a moderator:
@HighBredCloud - sorry for the delay on this. I think the below code should work as a scanner for this SuperTrend version. Please let me know if this seems to work out for you.

The current settings should give you any results where the supertrend crossed (up or down) within the past 3 candles.

If you were looking to scan specifically for up or down, i can adjust if needed.

Code:
# SuperTrend Yahoo Finance Replica - Modified from Modius SuperTrend
# Modified Modius ver. by RConner7
# SCANNER #
# Works similar to how Yahoo Finance Supertrend works and displays. Holds supertrend value until cross.

input AtrMult = 1.00;
input nATR = 6;
input AvgType = AverageType.HULL;
input PaintBars = yes;

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 ST_Cross = if (ST crosses above close) or (ST crosses below close) within 3 bars then 1 else 0;
 
@RConner7 Would you also be able to include the UP/DOWN scanner as well? Sometimes depending on the timeframe you scan on not everything appears right away...and sometimes it appears with delay. I run multiple scanners on my dedicated monitor just because of that reason. Besides I am sure others on here might find uses for either one. Some like myself...ONLY scan for stocks trending in a given direction depending on the market on that day.

Also not to hijack your other thread with your strategy...figure I will post this in here not to interfere.

I've been using this SuperTrend and been doing some tests on a possible strategy. I was able to replicate an MTF version of this SuperTrend from a CSA that I am testing to use on lower timeframes. I am using a 15 min chart for the main trend. I set the ATR MULT to .7 from default 1.0...I kept the NATR default at 6...I then use the same settings on 5 min chart...Lastly I use a 1 min timeframe set to a 2 min aggregation to avoid the whipsaw generated by the 1 min...I left the default settings on the 1 min time frame of 1.0 ATR MULT and 6 NATR.

The idea is to trade in the direction of the 15 min chart...IF the 15 min chart is GREEN...I go long...IF RED...I short. I use the 5 min for pullbacks and both 5 min and 15 min need to match up for any trade to happen. Lastly I go in on the 1 min timeframe that is set to 2 min aggregation.

To help with the possible exit I also use TMO with 3 different aggregation...15 min 5 min and 3 min on a 1 min timeframe. This further helps me narrow down the entry point and exit point.

I also use Trend Magic line ONLY as an additional confirmation...ANYTHING above it is confirming a long entry and below a short entry.

Overall I am surprised at how well this SuperTrend is working. Very responsive on even a 15 min timeframe...something most other SuperTrends lack. Its really hard to sit through the pullbacks just by using the SuperTrend alone for a day trader. We're not so much used to that as swing traders. This SuperTrend is by far the best one I've seen in terms of how responsive to price action it is.
 
@HighBredCloud - i separated the BULL / BEAR scanner for you. The 2 below should give you the results if within past 3 bars.

DOWN:
Code:
# SuperTrend Yahoo Finance Replica - Modified from Modius SuperTrend
# Modified Modius ver. by RConner7
# BEAR SCANNER #
# Works similar to how Yahoo Finance Supertrend works and displays. Holds supertrend value until cross.

input AtrMult = 1.00;
input nATR = 6;
input AvgType = AverageType.HULL;
input PaintBars = yes;

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 ST_Cross = if (ST crosses above close) within 3 bars then 1 else 0;


UP:
Code:
# SuperTrend Yahoo Finance Replica - Modified from Modius SuperTrend
# Modified Modius ver. by RConner7
# BULL SCANNER #
# Works similar to how Yahoo Finance Supertrend works and displays. Holds supertrend value until cross.

input AtrMult = 1.00;
input nATR = 6;
input AvgType = AverageType.HULL;
input PaintBars = yes;

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 ST_Cross = if (ST crosses below close) within 3 bars then 1 else 0;
 
Hey do you know if the supertrend indicator on Yahoo Finance repaints? I can't seem to find an answer anywhere :cry:
 
@dmaffo First and foremost...I saw your post about a week ago...I was testing what I am about to share...hence why I didn't reply sooner as I didn't want to point anyone in the wrong direction until I tested what I needed to test...Sorry to hear about your losses...This is definitely a learning curve with no easy short cuts. I have lost a small fortune myself so when I first started trading so I an definitely relate...They way you need to look at it is price of eduction...because when you do find something that works for you you can make up your losses in no time. The beauty about trading is that there are so many different ways to trade.

With that said I have found something that works for me...and hopefully it can work for others as well. Before I get there I would like to emphasize that it doesn't matter what your strategy is. In my opinion it is much easier finding the right stock to trade than it is to have the next "holy grail" strategy...and here's why;

I started paying attention to stocks that are trending for the day...TOS has a scanner where it shows you %Change Gainers/Losers from that list you can pick out stocks to trade for the day when you have other scanners search for the results in just those two subgroups.

When you are trading stocks that are trending in a given direction...it makes your strategy that much easier as half the work is already done by simply picking the right equity to trade for the day.

The next part that is very crucial is picking the right timeframe to trade on. To this day I keep flipping in the search of the perfect timeframe...until I settled on 10 min and 15 min...They are so close that to most traders out there it makes no sense trading such close timeframes...but again for my strategy it works.

I have tried from tick charts to 1 minute timeframes to 1 hour timeframes...either I would get whipsawed too much OR the pullbacks would be so extreme that it would wipe my entire profits. I always told myself that before I attempt any form of swing trading...I first need to learn how to trade on a longer timeframe...Ideally what I am after is buying the dips and selling the rallies on trending stocks intraday. It can be done...you just need to know what you're looking for.

With this in mind...check out few of the threads that I am sharing with you here...This is what I am using. This method is either good for scalping or it can be used for more of a intraday "swing" of buy the dips and sell the rallies. I stop trading when I reach my daily goal as I am still trying to perfect the strategy and I trade "scared money" because of the thousands I lost when I first started trading. This is not a good combination to be in such a state of mind...but most of us know that feeling all too well.

I personally use the SuperTrend Yahoo Finance Replica created by @RConner7. Really good stuff. Its very similar to the original SuperTrend by Mobius that many adhere to here...but I find the Yahoo version to hit faster.

https://usethinkscript.com/threads/supertrend-yahoo-finance-type-for-thinkorswim.1998/#post-27707
I set the 15 min chart to ATRMULT .5 and the 10 min I keep at default setting at 1.00 That is also a nice scanner that @RConner7 publicly shared in that same thread. The idea is to scan for the SuperTrend on the 15 min timeframe in %Change Gainers or Losers...ONCE you get those results on the 15 min timeframe...look on the 10 min timeframe and make sure the color of the trend aligns with the 15 min chart...enter and keep until you hit your scalp amount...OR until the next color change of the candles...

You can even further customize your watchlist column by adding a SuperTrend column as well...You can find it here:

https://usethinkscript.com/threads/...by-mobius-for-thinkorswim.7/page-8#post-13093
This is helpful as you can see how many bars in the particular equity is on the SuperTrend...that will make your decision easier as you can search for stocks to enter based on the highest count...or possibly catch reversals by the lowest count.

On such high timeframes as the 15 min and the 10 min while getting such scanner results as from the %Change Gainers or Losers you know that you are trading trending stocks...so you know that such moves are going to be for at least multiple candles...

You can also implement this RSI Strategy into the SuperTrend strategy above...In this thread you will find all the necessary indicators and watchlist columns needed to make trading easier.

https://usethinkscript.com/threads/simple-yet-very-powerful-swing-trading-strategy.272/
ADVANCED VERSION

https://usethinkscript.com/threads/simple-yet-very-powerful-advanced-version.599/
There is a watchlist column there somewhere in either of the two RSI Strategy threads where you can see the RSI readings when set to the 1 hour timeframe...so basically from the results that you get from your scanner...You're able to pick which stocks to chose that meet the criteria better over the others. As long as the RSI is above 60 on 1 HOUR...you're good for a LONG position...and below 40 RSI on 1 HOUR...you're good for a SHORT.

I also find this indicator very useful...You can use this as a get out or get in each time the RSI crosses the 5 SMA moving average on both timeframes...I personally set it to reflect the same settings as the RSI Strategy I mentioned above 60/40 OB/OS and 7 period RSI...

https://usethinkscript.com/threads/moving-average-crossover-rsi-indicator-for-thinkorswim.185/
Just be careful and don't get caught up in the RSI 5 SMA too much...as it will whipsaw you into an oblivion on lower timeframes...I do not recommend this on anything lower than 5 min...and personally find the best results to be on 15 min and UP...The higher the timeframe the better the move when it comes to this indicator.

I am also going to link a OneNote where you can find all sorts of cool studies that you can look through...Lots of great info there for any trader on any level.

https://onedrive.live.com/redir?res...02.13.|30461c4b-420e-4b83-b56f-55faf5d1461b/)
Pick what works for you...if you chose to use what I suggest than let me know how its working out for you and what you see as improvements that would need to be added to this strategy...I think what I gave you is a great start. I hope that the info I shared with you can help recoup your losses...And for anyone else who reads this and finds it useful I hope it works out for you too...as I have personally spent years working very long hours to do several trial and error research to fail over and over again...THIS I have a good feeling about and from my tests thus far will bring you good results as long as you follow the rules you set for yourself and are not greedy.

@BenTen Because this is so long...and kind of detailed...perhaps you can make this into a SuperTrend Yahoo strategy post...I think there is good info here that others can get from this without it getting lost in this thread...just a thought.
 
@HighBredCloud this is very informative and looks very good on the charts I tested so far. It seems like 10-15min charts filter out some of the false signals. I found more entries with 5min charts though.

I can't seem to figure out the exact time to enter when SuperTrend Yahoo Edition is repainting. Do you wait for the bar to close? or do you wait until a lower time frame confirms? or.....?
 
@HighBredCloud this is very informative and looks very good on the charts I tested so far. It seems like 10-15min charts filter out some of the false signals. I found more entries with 5min charts though.

I can't seem to figure out the exact time to enter when SuperTrend Yahoo Edition is repainting. Do you wait for the bar to close? or do you wait until a lower time frame confirms? or.....?

The idea is to make sure that the "anchor chart" in my case the 15 min is trending in the direction of the SuperTrend. For a LONG position the SuperTrend needs to be GREEN on the 15 min chart...and vice versa...ONLY then you can look at the 10 min timeframe to see if the SuperTrend is also GREEN...if it is not GREEN...then wait until the next candle on the 10 min timeframe to enter.

You can try to use a 5 min for an entry instead of the 10 min...just be aware that the smaller timeframe you enter on the more whipsaw you may experience. To combat that I would change the settings on the 5 minute to something like 1.5 ATR MULT and 10 NATR...

Essentially you are waiting on the lower timeframe to confirm your entry...Your exit should always be on the lower timeframe...I hope that helps.
 
@dmaffo First and foremost...I saw your post about a week ago...I was testing what I am about to share...hence why I didn't reply sooner as I didn't want to point anyone in the wrong direction until I tested what I needed to test...Sorry to hear about your losses...This is definitely a learning curve with no easy short cuts. I have lost a small fortune myself so when I first started trading so I an definitely relate...They way you need to look at it is price of eduction...because when you do find something that works for you you can make up your losses in no time. The beauty about trading is that there are so many different ways to trade.

With that said I have found something that works for me...and hopefully it can work for others as well. Before I get there I would like to emphasize that it doesn't matter what your strategy is. In my opinion it is much easier finding the right stock to trade than it is to have the next "holy grail" strategy...and here's why;

I started paying attention to stocks that are trending for the day...TOS has a scanner where it shows you %Change Gainers/Losers from that list you can pick out stocks to trade for the day when you have other scanners search for the results in just those two subgroups.

When you are trading stocks that are trending in a given direction...it makes your strategy that much easier as half the work is already done by simply picking the right equity to trade for the day.

The next part that is very crucial is picking the right timeframe to trade on. To this day I keep flipping in the search of the perfect timeframe...until I settled on 10 min and 15 min...They are so close that to most traders out there it makes no sense trading such close timeframes...but again for my strategy it works.

I have tried from tick charts to 1 minute timeframes to 1 hour timeframes...either I would get whipsawed too much OR the pullbacks would be so extreme that it would wipe my entire profits. I always told myself that before I attempt any form of swing trading...I first need to learn how to trade on a longer timeframe...Ideally what I am after is buying the dips and selling the rallies on trending stocks intraday. It can be done...you just need to know what you're looking for.

With this in mind...check out few of the threads that I am sharing with you here...This is what I am using. This method is either good for scalping or it can be used for more of a intraday "swing" of buy the dips and sell the rallies. I stop trading when I reach my daily goal as I am still trying to perfect the strategy and I trade "scared money" because of the thousands I lost when I first started trading. This is not a good combination to be in such a state of mind...but most of us know that feeling all too well.

I personally use the SuperTrend Yahoo Finance Replica created by @RConner7. Really good stuff. Its very similar to the original SuperTrend by Mobius that many adhere to here...but I find the Yahoo version to hit faster.

https://usethinkscript.com/threads/supertrend-yahoo-finance-type-for-thinkorswim.1998/#post-27707
I set the 15 min chart to ATRMULT .5 and the 10 min I keep at default setting at 1.00 That is also a nice scanner that @RConner7 publicly shared in that same thread. The idea is to scan for the SuperTrend on the 15 min timeframe in %Change Gainers or Losers...ONCE you get those results on the 15 min timeframe...look on the 10 min timeframe and make sure the color of the trend aligns with the 15 min chart...enter and keep until you hit your scalp amount...OR until the next color change of the candles...

You can even further customize your watchlist column by adding a SuperTrend column as well...You can find it here:

https://usethinkscript.com/threads/...by-mobius-for-thinkorswim.7/page-8#post-13093
This is helpful as you can see how many bars in the particular equity is on the SuperTrend...that will make your decision easier as you can search for stocks to enter based on the highest count...or possibly catch reversals by the lowest count.

On such high timeframes as the 15 min and the 10 min while getting such scanner results as from the %Change Gainers or Losers you know that you are trading trending stocks...so you know that such moves are going to be for at least multiple candles...

You can also implement this RSI Strategy into the SuperTrend strategy above...In this thread you will find all the necessary indicators and watchlist columns needed to make trading easier.

https://usethinkscript.com/threads/simple-yet-very-powerful-swing-trading-strategy.272/
ADVANCED VERSION

https://usethinkscript.com/threads/simple-yet-very-powerful-advanced-version.599/
There is a watchlist column there somewhere in either of the two RSI Strategy threads where you can see the RSI readings when set to the 1 hour timeframe...so basically from the results that you get from your scanner...You're able to pick which stocks to chose that meet the criteria better over the others. As long as the RSI is above 60 on 1 HOUR...you're good for a LONG position...and below 40 RSI on 1 HOUR...you're good for a SHORT.

I also find this indicator very useful...You can use this as a get out or get in each time the RSI crosses the 5 SMA moving average on both timeframes...I personally set it to reflect the same settings as the RSI Strategy I mentioned above 60/40 OB/OS and 7 period RSI...

https://usethinkscript.com/threads/moving-average-crossover-rsi-indicator-for-thinkorswim.185/
Just be careful and don't get caught up in the RSI 5 SMA too much...as it will whipsaw you into an oblivion on lower timeframes...I do not recommend this on anything lower than 5 min...and personally find the best results to be on 15 min and UP...The higher the timeframe the better the move when it comes to this indicator.

I am also going to link a OneNote where you can find all sorts of cool studies that you can look through...Lots of great info there for any trader on any level.

https://onedrive.live.com/redir?res...02.13.|30461c4b-420e-4b83-b56f-55faf5d1461b/)
Pick what works for you...if you chose to use what I suggest than let me know how its working out for you and what you see as improvements that would need to be added to this strategy...I think what I gave you is a great start. I hope that the info I shared with you can help recoup your losses...And for anyone else who reads this and finds it useful I hope it works out for you too...as I have personally spent years working very long hours to do several trial and error research to fail over and over again...THIS I have a good feeling about and from my tests thus far will bring you good results as long as you follow the rules you set for yourself and are not greedy.

@BenTen Because this is so long...and kind of detailed...perhaps you can make this into a SuperTrend Yahoo strategy post...I think there is good info here that others can get from this without it getting lost in this thread...just a thought.
Absolutely amazing attention to detail and generous. Thank you so very much for your consideration, time and genuine care for me and other members. I just read all of this and will start to implement it and start testing it all. This week I managed to claw myself to a very positive position in where I am just under $5k total losses and if I were to count TOS $comm's then add another $5k. So 10k from absolute break even point and that believe it or not today makes me very happy compared to where I was 3 weeks ago!!!
I have 8 screens with all kinds of charts times and indicators just to see what proves best for me and so far swingarm, macdavgrsi supertrend, supertrend, divergence vic d,carter ttm wave and squeeze, seem to be where I am finding most helpful thus far.
Lots of other things are either not accurate or way off and delayed not helping when in heat of market. They plot too late and arent of any help to actually trade. Very excited to try something new. I know once I have a wheel that turns correctly I can just size into positions and we good. The first 2 accounts I blew up (July 4 style) truly humbled me and as you stated were very good lessons. I am now also looking for something to log all my trades with. I spend countless hours going through entries, days, times in order to see where I am most effective or vulnerable. I also learnt and implemented this week sizing into positions which for my personality worked out great. I can get order filled and then size into position as trend formed and then exited once I saw momentum slow down.
Thank you
 
Hey @HighBredCloud, thanks for all the tips. I was able to turn profit with this technique. However, supertrend keeps repainting. I can't seems to nail down a way to prevent false entries. In the screenshot below, RSI and crossing of price over supertrend shows bullish, but if the price falls before the bar is closed, it repaints. Do you have any tips to confirm further before entry? This happens on both 15min and 10min charts.

HsW41NG.png
 
@dmaffo The bottom line is...You just need to find what works for you. So many ways to trade from scalping to swing trading...not everything works as it all depends on what type of a trader you are. The strategy I mentioned seems to be for both scalpers and intra day swing traders...ONLY tip I can give you is don't get greedy until you make your money back...I set a daily goal for $500 and then I quit live trading...and switch to paper trading...Not only do you practice discipline that way but you're also getting screen time and you can practice other strategies...Sometimes it sux as paper trading you find yourself making thousands while you quit live trading long already...It is what it is. When you finally figure what works for you then you the amount you make is limitless...
 
@barbaros

I would highly suggest using the scanner that @RConner7 made and shared in this thread...try putting more than one condition of the scanner than just 15 min and 10 min...for instance...1 hour...15 min and 5 min SuperTrend to narrow down your entry when all 3 line up color wise...ALSO search in % GAINERS or % LOSERS...This technique was built around trending stocks...

Implement a MACD scanner also set to 15 min...That way the results that you get should filter out the false positives...Also implement RSI scan set to 1 hour that reflect 7 periods 60/40 OB/OS conditions...

When you can find the right stocks that the SuperTrend is going UP or DOWN on the 1 hour...15 min and 5 min with MACD also agreeing with those trends you should stay in the GREEN...Use the 5 min candle color change for exits...RSI is a bonus. All that criteria will search for trending stocks...Try to avoid trades by forcing trades on do nothing stocks...Trading the right stock will do most of the work for you...All you need to do is find them using the criteria I mentioned.

Let me know how this goes...I have also tinkered around with pivot points and this strategy...and would ONLY trade when a pivot point was crossed on the 15 min timeframe on top of EVERYTHING else that I mentioned above in this post. That seemed to get less results from the scanner BUT the moves were consistent.
 
Last edited:
@HighBredCloud this is pretty funny. As I was typing another response, I received an email about your response. I was writing about adding MACD and TrendPivots. I found today that TrendPivots help a good amount of filtering. However, MACD mostly agrees with SuperTrend already. With TrendPivots, I had 2 successful trades, 29 point move with /ES, but /ES was pretty volatile this morning anyway. There seems to be a period that side ways chop gives false signals. If there is a way to determine trending vs non-trending, it may help. I will try MTF filtering next like you recommended.
 
@barbaros I updated my response as well.../ES is not really trending...its just market sentiment...So it can be trending...or in a channel...I tried using this technique on SPY and it does seem to be very text book...MACD set to 15 min will help filter out the fake moves that may not end up going anywhere on lower timeframes...Try implementing all of the criteria by using multiple scanners all in ONE scan and trade stocks other that it generates other than /ES...
 
i'm a little unclear on the scanner setup, 3 separate scanners? or 3 separate conditions on one scanner.
Thanks
 
If anyone is interested, I modified this a little to show a label for the selected timeframe. You can add more than one to show different timeframes in the same chart. Make sure the timeframes you select are higher than the chart setting.

Python:
# SuperTrend Yahoo Finance Replica - Modified from Modius SuperTrend - MTF Labels Version
# Modified Modius ver. by RConner7
# Modified by barbaros for multi time frame label

# Works similar to how Yahoo Finance Supertrend works and displays. Holds supertrend value until cross.

input agg1 = AggregationPeriod.HOUR;
input AtrMult = 1.00;
input nATR = 6;
input AvgType = AverageType.HULL;

def ATR = MovingAverage (AvgType, TrueRange(high(period = agg1), close(period = agg1), low(period = agg1)), nATR);
def UP_Band_Basic = HL2(period = agg1) + (AtrMult * ATR);

def LW_Band_Basic = HL2(period = agg1) + (-AtrMult * ATR);

def UP_Band = if ((UP_Band_Basic < UP_Band[1]) or (close(period = agg1)[1] > UP_Band[1])) then UP_Band_Basic else UP_Band[1];

def LW_Band = if ((LW_Band_Basic > LW_Band[1]) or (close(period = agg1)[1] < LW_Band[1])) then LW_Band_Basic else LW_Band[1];

def ST = if ((ST[1] == UP_Band[1]) and (close(period = agg1) < UP_Band)) then UP_Band
else if ((ST[1] == UP_Band[1]) and (close(period = agg1) > Up_Band)) then LW_Band
else if ((ST[1] == LW_Band[1]) and (close(period = agg1) > LW_Band)) then LW_Band
else if ((ST[1] == LW_Band) and (close(period = agg1) < LW_Band)) then UP_Band
else LW_Band;

AddLabel(yes, if agg1== aggregationPeriod.MONTH then "M"
    else
    if agg1== aggregationPeriod.WEEK then "W"
    else
    if agg1== aggregationPeriod.FOUR_DAYS then "4D"
    else
    if agg1== aggregationPeriod.THREE_DAYS then "3D"
    else
    if agg1== aggregationPeriod.TWO_DAYS then "2D"
    else
    if agg1== aggregationPeriod.DAY then "D"
    else
    if agg1== aggregationPeriod.FOUR_HOURS then "4H"
    else
    if agg1== aggregationPeriod.TWO_HOURS then "2H"
    else
    if agg1== aggregationPeriod.HOUR then "1H"
    else
    if agg1== aggregationPeriod.THIRTY_MIN then "30m"
    else
    if agg1== aggregationPeriod.TWENTY_MIN then "20m"
    else
    if agg1== aggregationPeriod.FIFTEEN_MIN then "15m"
    else
    if agg1== aggregationPeriod.TEN_MIN then "10m"
    else
    if agg1== aggregationPeriod.FIVE_MIN then "5m"
    else
    if agg1== aggregationPeriod.FOUR_MIN then "4m"
    else
    if agg1== aggregationPeriod.THREE_MIN then "3m"
    else
    if agg1== aggregationPeriod.TWO_MIN then "2m"
    else
    if agg1== aggregationPeriod.MIN then "1m"
    else "",
         if close(period = agg1) < ST
                then Color.RED
               else if close(period = agg1) > ST
                    then Color.GREEN
                     else Color.DARK_GRAY);

# End Code SuperTrend Yahoo Finance Replica - MTF Labels Version
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
319 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