senpai

Spyfrat BB50 Strategy

202 2 13
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
United States
United Kingdom
India
Deutschland
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Priority Support Ideas Published Followers Following Private Messages Chat Sign Out