TradingView
KivancOzbilgic
Sep 10, 2020 5:14 PM

SuperTrend STRATEGY 

Bitcoin / TetherBittrex

Description

STRATEGY version of SuperTrend Indicator:

SuperTrend is one of the most common ATR based trailing stop indicators.

In this version you can change the ATR calculation method from the settings. Default method is RMA, when the alternative method is SMA .


The indicator is easy to use and gives an accurate reading about an ongoing trend. It is constructed with two parameters, namely period and multiplier. The default values used while constructing a superindicator are 10 for average true range or trading period and three for its multiplier.

The average true range (ATR) plays an important role in 'Supertrend' as the indicator uses ATR to calculate its value. The ATR indicator signals the degree of price volatility .

The buy and sell signals are generated when the indicator starts plotting either on top of the closing price or below the closing price. A buy signal is generated when the ‘Supertrend’ closes above the price and a sell signal is generated when it closes below the closing price.

It also suggests that the trend is shifting from descending mode to ascending mode. Contrary to this, when a ‘Supertrend’ closes above the price, it generates a sell signal as the colour of the indicator changes into red.

A ‘Supertrend’ indicator can be used on equities, futures or forex, or even crypto markets and also on daily, weekly and hourly charts as well, but generally, it fails in a sideways-moving market.


Source function added to use the indicator as the ATR Trailing Stop indicator.
Just change source type hl2 to close.
different variations might be useful.

Release Notes

fixed time settings
Comments
Neev3009
This is where it all begins! THANKYOU SO MUCH!
dhavanchopra
sir how to set alert for crossovers
JanStrw
@dhavanchopra, would be nice to know
wbburgin
@dhavanchopra, Edit the code, add the following two lines:

alertcondition(buySignal, "Supertrend Buy")
alertcondition(sellSignal, "Supertrend Sell")

Remove lines 48-52 (get rid of the strategy, because alert conditions can only be triggered in indicators), and change the word 'strategy' in line 6 to 'indicator'.

This will now enable you to see "Supertrend Buy" and "Supertrend Sell" as conditions for creating an alert.
dhavanchopra
@wbburgin, thanks
NeeWak
@wbburgin, now it's "study" instead of "indicator"
mirhom
Nasıl çalıştığını anlatsayfiniz hocam daha güzel olacakti
KivancOzbilgic
@mirhom, Youtube videosu yayınlayacağım
Civan-L
@KivancOzbilgic, Evet hocam bekliyoruz, :-)
esko29
@KivancOzbilgic, link gönderir misiniz video için teşekkürler
More