LonesomeTheBlue

Bollinger Bands MTF [LonesomeTheBlue]

With this script you can follow Bollinger Bands for current and higher time frame together. Higher time frame is calculated by script.

if current period
1m => higher period=5m
3m => higher period=5m
5m => higher period=15m
15m => higher period=1h
30m => higher period=1h
45m => higher period=1h
1h => higher period=4h
2h => higher period=4h
3h => higher period=4h
4h => higher period=1day
1day => higher period=1week
Notas de prensa: in this new version you can choose the time frame, it's not automatic.
Notas de prensa: upgraded to v4
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con las Normas internas. Puede marcarlo como favorito para usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?

Comentarios

100 monedas
Responder
Version 4 of this script

//@version=4
study("Bollinger Bands MTF ", overlay=true)
//HigherTimeFrame = period == '1' ? '5' : (period == '3' ? '5' : (period == '5' ? '15' : (period == '15' ? '60' : (period == '30' ? '60' : (period == '45' ? '60' : (period == '60' ? '240' : (period == '120' ? '240' : (period == '180' ? '240' : (period == '240' ? 'D' : (period == 'D' ? 'W' : 'W'))))))))))

HigherTimeFrame = input(title="Higher time frame", type=input.resolution, defval='60')

bblength = input(20, title="Length", minval=1)
sdtspm = input(2.0, title="Mult", minval=1.0)
basis = sma(close, bblength)
dev = sdtspm * stdev(close, bblength)
upper = basis + dev
lower = basis - dev
L1 = plot(upper, color=color.gray,title="BB Upper Band")
L2 = plot(lower, color=color.gray,title="BB Lower Band")
plot(basis, color=color.black,title="BB Mid Band")
fill(L1, L2, color=color.green, transp=60)

altmid = sma(security((syminfo.tickerid), HigherTimeFrame, basis),8)
altupper = sma(security((syminfo.tickerid), HigherTimeFrame, upper),8)
altlower = sma(security((syminfo.tickerid), HigherTimeFrame, lower),8)
plot(altmid, color=color.black, title="BB Alt Mid Band",linewidth=2)
LA1 = plot(altupper, color=color.black, title="BB Alt Upper Band",linewidth=2)
LA2 = plot(altlower, color=color.black, title="BB Alt Lower Band",linewidth=2)
fill(LA1, LA2, color=color.green, transp=30)
Responder