Supertrend V1.0 - Buy or Sell Signal

Supertrend Indicator with Buy and Sell Indicators. Supertrend is quite a popular indicator. To know more about it check out the article below.

10 Things to know about Supertrend
Remove from Favorite Scripts Add to Favorite Scripts
//Author - Rajandran R
study("Supertrend V1.0 - Buy or Sell Signal", overlay = true)

Factor=input(3, minval=1,maxval = 100)
Pd=input(7, minval=1,maxval = 100)


TrendUp=close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up
TrendDown=close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn

Trend = close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],1)
Tsl = Trend==1? TrendUp: TrendDown

linecolor = Trend == 1 ? green : red

plot(Tsl, color = linecolor , style = line , linewidth = 2,title = "SuperTrend")

plotshape(cross(close,Tsl) and close>Tsl , "Up Arrow", shape.triangleup,location.belowbar,green,0,0)
plotshape(cross(Tsl,close) and close<Tsl , "Down Arrow", shape.triangledown , location.abovebar, red,0,0)
//plot(Trend==1 and Trend[1]==-1,color = linecolor, style = circles, linewidth = 3,title="Trend")

plotarrow(Trend == 1 and Trend[1] == -1 ? Trend : na, title="Up Entry Arrow", colorup=lime, maxheight=60, minheight=50, transp=0)
plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=60, minheight=50, transp=0)

You can have alarm, just set up an alert choose the indicator then the arrow up and condition - value more than 0 if the arrow will appear it will be always more than zero and it works, have to add second one for arrow down, there is repainting issue though ...
+4 Reply
Hi All, does anyone know what needs to be added to the script in order to backtest this in Tradingview?
+2 Reply
HPotter rocketrader
Look at this.
+1 Reply
This is repainting. I was observing a buy signal, it was there, and then when there was a dump, there was a sell signal, and previous buy signal was gone.
+5 Reply
Hi everyone, does anyone notice any repaint with this indicator.
Guys, does anyone know how to set up the alerts for this indicator here on Tradingview? There are more options and it still doesnt work... Thank you!!!
+12 Reply
Hi Rajendran, Fan of your's site http://www.marketcalls.in. Grt job buddy. But plz guide me how could I add this indicator to tradingview chart as I am quite new to this site I don't know where to add this code.
+21 Reply
Check http://www.tradeseven.com for metatarder platforms
supertrend is so similar to EMA 50.
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out