blindfreddy

SuperTrend BF

1739
The SuperTrend overlay by Olivier Seban provides an excellent 'trailing stop' that can be used with any bar length for bullish or bearish moves. My preferred timeframe is weekly for capturing huge (Super) moves. For instance applying it to AAPL, this baby would have us reeling in a fivebagger over the course of three years. Patience and holding your nerve are key to trend following and I like to think of SuperTrend as a great big visual 'crutch' right there on the chart.
Essentially this is an average true range trailing stop, of which there are several versions available (eg see the Sylvain Vervoort version programmed by H Potter). SuperTrend differs by referring the stop back from the middle of the bar (High+Low)/2. This is similar to using the Vervoort with a tweak to the number of ATR's considered. At the end of the day its a matter of preference and what works best for you.

Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?
//SuperTrend - Originally by Olivier Seban
//Programmed by BlindFreddy 
//Blog: http://blindfreddy.postagon.com
study(title="SuperTrend BF", overlay = true)
Length = input(10, minval=1),
mult = input(3, type="float",minval=1)
avgTR = atr(Length)
newshortband= hl2 + avgTR * mult
newlongband= hl2 - avgTR * mult
longband=close[1]>longband[1]? max(newlongband,longband[1]) : newlongband
shortband=close[1]<shortband[1]? min(newshortband,shortband[1]) : newshortband
trend = close > shortband[1] ? 1: close< longband[1]? -1: nz(trend[1],1)
supt = trend==1? longband: shortband
dotcolor = trend==1? green: maroon
plot(supt, color= dotcolor , style=circles, linewidth=3,title="SuperTrend")