Shanxia

Supertrend Bands

Supertrend Bands

What is the Supertrend indicator?

"The Supertrend indicator is a trend following overlay on your trading chart, much like a moving average, that shows you the current trend direction.

The indicator works well in a trending market but can give false signals when a market is trading in a range.

It uses the ATR ( average true range ) as part of its calculation which takes into account the volatility of the market. The ATR is adjusted using the multiplier setting which determines how sensitive the indicator is."

"For the basic Supertrend settings, you can adjust period and factor:

- The period setting is the lookback for the ATR calculation
- Factor is the what the ATR is multiplied by to offset the bands from price"

How to use this indicator

This indicator is inspired by a strategy I found. It includes four Supertrend indicators, each with different settings that displays trend strength and support/resistance zones. The default settings are optimal for cryptocurrency but do work quite well for traditional also. I highly recommend you try experimenting with different settings, increasing them to suit the instrument.

The bands are set from low to high, Band 1 being the fastest and Band 4 being the slowest. Band 4 is the one that sets the overall trend so when price is above Band 4, the trend is bullish and vice versa. Trend is strongest when price is above/below Band 1 and gets weaker as it filters through each band. Band 4 provides the strongest support/resistance and if that breaks the trend flips.

In the menu, you will see an option called "Remove Anti Trend?". It is enabled by default and it removes any bearish /resistance bands when the trend is up and any bullish /support bands when the trend is down. When turned off, it will show all Supertrend Bands as they are by default.

Bar Colors

Bar colors are optional and they reflect the current trend strength based on the Supertrend bands.

Alternate ways of using this indicator

You could leave everything as default or you can display individual bands. For instance, because I use many overlay indicators, most of the time I turn off all the bands and only show bar colors:


You can also turn off Bands 1 and 2 and only show the two slowest lengths:



This removes the noise of the two faster Supertrends.

Or just show the two fastest bands:


Any suggestions to improve this indicator are most welcome :)
릴리즈 노트: Thank you @kkeskar92 for suggesting adding MTF.
I've added an input which allows multiple timeframes to be chosen.
Because Pinescript's inbuilt resolution function has some glitches with this particular script, each timeframe had to be coded manually.
Let me know if there are other timeframes that should be included.
릴리즈 노트: Added Alert conditions for overall trend change (band 4). Make sure to select "Once Per Bar Close" in the alert settings otherwise it'll give incorrect alerts before the bar is closed.
릴리즈 노트: Added more alerts for each band.
오픈 소스 스크립트

진정한 TradingView의 정신에 따라, 이 스크립트의 작성자는 스크립트를 오픈소스로 게시했기에 거래자들이 이해하고 확인할 수 있습니다. 작가님께 건배! 스크립트를 무료로 사용할 수 있지만, 게시물에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 당신은 스크립트를 차트에 사용하기 위해 그것을 즐겨찾기 할 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

코멘트

Chart Examples:

BTCUSD 5 minute:



ETHUSD 5 minute:



SPXUSD Weekly:



EURUSD 1 HR:

+2 응답
Cool script! I'd love to see some alerts added too and maybe when each level is broken.

I've noticed the MTF repaints a lot if you select a HTF and use the replay function. Maybe it's possible to do MTF without lookahead?

Tradingview own "ratings" script manage to do MTF without any repaint at all, maybe the technique behind that can be used?

Cheers
+1 응답
Shanxia jensencrypto
@jensencrypto, hey mate thanks for your suggestion, I've added alertconditions for all the band levels. lmk if there are any glitches.

With the higher TF repaint I've tried various methods of reducing it further and looked into TV's Technical Ratings Script but there are errors each time I try. As for lookahead, having that on is what reduces repaint and I tested it with it off and it offsets higher TF's too much.

If anyone can suggest a way to reduce repaint more on supertrend it'd be much appreciate it :D
응답
Nice script, man. Very pretty
+1 응답
Why not make a MTF version of same? That will show trend in larger perspective
+1 응답
Shanxia kkeskar92
@kkeskar92, I’ve updated the script with an option to choose different TFs. :) thank you for your suggestion!
+3 응답
kkeskar92 Shanxia
@Shanxia, Thank you so much...thats great.
+1 응답