senpai

Spyfrat BB50 Strategy

286 2 29
BB50 Strategy from Spyfrat (Hernan Segovia) concept
Remove from Favorite Scripts Add to Favorite Scripts
// @author Senpai 
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study(title = "Spyfrat BB50 Strategy", shorttitle = "SpyfratBB50")
source = close
length = input(50, minval=1)
mult = input(0.2, title="Mult Factor", minval=0.001, maxval=50)
alertLevel=input(0.24)
impulseLevel=input(0.40)
showRange = input(false, type=bool)


// Calc BB
basis = sma(source, length)
dev = mult * stdev(source, length)
upper = basis + dev
lower = basis - dev
// Calc Impulse
//bbr = ((source - lower)/(upper - lower))/10
//bbi = bbr - nz(bbr[1]) 
//bbc = iff(bbi>0, 
//        iff(bbi>alertLevel and bbi<impulseLevel, lime, iff(bbi>impulseLevel, orange, aqua)),  
//        iff(bbi<-alertLevel and bbi>-impulseLevel, red, iff(bbi<-impulseLevel, orange, aqua))
//        )
bbr = source>upper?(((source-upper)/(upper-lower))/10): source<lower?(((lower-source)/(upper-lower))/10) : 0.1
bbi = bbr - nz(bbr[1]) 
bbc = iff(bbi>0, 
      iff(bbi>alertLevel and bbi<impulseLevel, lime, iff(bbi>impulseLevel, orange, aqua)),  
      iff(bbi<-alertLevel and bbi>-impulseLevel, red, iff(bbi<-impulseLevel, orange, aqua))
        )
// Plot Ian Woodward's suggested Reference Levels
plot(0, color=gray, title="MidLine", style=3)
plot( impulseLevel, color=gray, style=line, linewidth=1, title="Impulse+")
plot( alertLevel, color=gray, style=3, linewidth=1, title="Alert+")
plot( -alertLevel, color=gray, style=3, linewidth=1, title="Alert-")
plot( -impulseLevel, color=gray, style=line, linewidth=1, title="Impulse-")

plot(showRange ? bbr : na, color=gray, style=area, title="Range+", linewidth=0, transp=80)
plot(showRange ? -bbr : na, color=gray, style=area, title="Range-", linewidth=0, transp=80)

plot(bbi, color=bbc, style=histogram, linewidth=2)



sir @senpai , paano po gamitin ung sa pinakababa na graph?
Reply
galing naman po nito :)
Reply
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 繁體中文
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