RicardoSantos

[RS]Multiple Bollinger Bands Candles V0

EXPERIMENTAL: using multiple length bollinger bands to create a better reading of ?price/range? strength?.
• calculates 2 candle plots for upper and lower bands, were the high and low are the extremes of the bands,
open is the previous close of the band and close is the extreme midline.
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
study(shorttitle="[RS]mBBC V0", title="[RS]Multiple Bollinger Bands Candles V0", overlay=true)
length0 = input(4, minval=1)
length1 = input(8, minval=1)
length2 = input(16, minval=1)
length3 = input(32, minval=1)

src = input(close, title="Source")
mult = input(2.0, minval=0.001, maxval=50)

deviation(_s, _l) => mult * stdev(_s, _l)
base0 = sma(src, length0)
base1 = sma(src, length1)
base2 = sma(src, length2)
base3 = sma(src, length3)

upper0 = base0 + deviation(src, length0)
upper1 = base1 + deviation(src, length1)
upper2 = base2 + deviation(src, length2)
upper3 = base3 + deviation(src, length3)

lower0 = base0 - deviation(src, length0)
lower1 = base1 - deviation(src, length1)
lower2 = base2 - deviation(src, length2)
lower3 = base3 - deviation(src, length3)

mbb_upper_high = max(upper0, max(upper1, max(upper2, upper3)))
mbb_upper_low = min(upper0, min(upper1, min(upper2, upper3)))
mbb_upper_close = max(base0, max(base1, max(base2, base3)))
mbb_lower_high = max(lower0, max(lower1, max(lower2, lower3)))
mbb_lower_low = min(lower0, min(lower1, min(lower2, lower3)))
mbb_lower_close = min(base0, min(base1, min(base2, base3)))

upper_palete = falling(mbb_upper_close, 1)?orange:rising(mbb_upper_close, 1)?olive:silver
lower_palete = falling(mbb_lower_close, 1)?orange:rising(mbb_lower_close, 1)?olive:silver

plotbar(mbb_upper_close[1], mbb_upper_high, mbb_upper_low, mbb_upper_close, color=upper_palete)//, wickcolor=orange)
plotbar(mbb_lower_close[1], mbb_lower_high, mbb_lower_low, mbb_lower_close, color=lower_palete)//, wickcolor=olive)