munkeefonix

Bollinger Bands Time

Bollinger bands that are fixed to a time interval. The time interval can be set in minutes or days.

Parameters
Daily Interval: If checked then days are used for the interval. If unchecked then minutes will be used.
Interval: The interval to use for the indicator.
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 lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?
//  Bollinger bands that will remain fixed to a time interval. 
//
//  @author munkeefonix
//  https://www.tradingview.com/u/munkeefonix/
//
//  Input values:
//  Daily Interval: If checked then days are used for the interval.  If unchecked then minutes will be used.
//  Interval: The interval to use for the indicator. 
study(shorttitle="BB Time", title="Bollinger Bands Time", overlay=true)

_source = close

multIntra()=>(isintraday ? 1.0 : (isdaily ? 1440.0 : isweekly ? 10080.0 : 43320.0))
multDaily()=>multIntra() / 1440.0

_useDaily=input(false, "Daily Interval")
_t=input(60.0, "Interval", float, minval=1.0) / (_useDaily ? multDaily() : multIntra())

_length = input(20, minval=1, title="Length")
_mult = input(2.0, minval=0.001, maxval=50, title="Std Dev")

_lenScale = round(_length * _t / interval)
_basis = sma(_source, _lenScale)
_dev = _mult * stdev(_source, _lenScale)

_offset = round(input(0, type=float, title="Offset") * (_t / interval))


plot(_basis, color=black, title="Basis", linewidth=2, offset=_offset)
_p1 = plot(_basis + _dev, color=black, linewidth=1, offset=_offset, title="Upper")
_p2 = plot(_basis - _dev, color=black, linewidth=1, offset=_offset, title="Lower")
fill(_p1, _p2, color=black, transp=90, title="Fill")