rajandran.r

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
http://www.marketcalls.in/amibroker/10-things-to-know-about-supertrend-v2-0-afl-code.html
Remove from Favorite Scripts Add to Favorite Scripts
//Author - Rajandran R
//www.marketcalls.in
study("Supertrend V1.0 - Buy or Sell Signal", overlay = true)

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


Up=hl2-(Factor*atr(Pd))
Dn=hl2+(Factor*atr(Pd))


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)

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.
+1 Reply
Hi everyone, does anyone notice any repaint with this indicator.
Reply
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!!!
+10 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.
+14 Reply
Check http://www.tradeseven.com for metatarder platforms
Reply
supertrend is so similar to EMA 50.
Reply
Hi Rajandran,


This looks like a great indicator, thanks for sharing.

I noticed on your site you have version 5 of this indicator. Would you be able to update here, and also, could you create a scanner (based on this indicator) that can scan Russell 3000 stocks and forex pairs?

Thank you.
Reply
Hello.
Could you please explain me, this part of the script "TrendUp=close>TrendUp? max(Up,TrendUp) : Up" Isn't it a circular reference? As far as I understand, function "TrendUp" refer to itself. Actually I'm trying to make this indicator in Metastock and Metastock doesn’t allow to make circular references. Can somebody explain me am I wrong and example above isn’t a circular reference or I just misunderstand calculation of this functions (TrendUp in this example)?
Thank you))
Reply
Comment removed
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
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