kingthies

KBC

kingthies Zaktualizowano   
KBC combines the logarithmic bollinger bands with keltner channels.
Informacje o Wersji:
Keltner Channel + Bollinger Band Combination
Concept published by Eric Thies 2018 | Updated 2021

U+2588 Changes Made
  • Upgraded to Pine v4 + Visual Plotting Updated
  • Removal of logarithmic input, replaced with standard calculation
  • Source formatted to updated and recommended look

// [pine]
// © kingthies | This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/

//@version=4
study(title="Keltner + Bollinger Band Combination [kingthies]", shorttitle="KBC [kingthies]", overlay=true) 

// !<------ Inputs & Strings -------> 
src = input(close, type=input.source, title="Bollinger and Keltner Source"), length = input(20, minval=1, title="BBand Length"), mult = input(2.0, minval=0.001, maxval=50, title="BBand Standard Deviations"), 
offset = input(0, title="Offset"), basis = sma(src, length), dev = mult * stdev(src, length), upper = basis + dev, lower = basis - dev
useTrueRange = input(true, title='Toggle True Range on Kelts?'), keltlength = input(20, minval=1, title="Kelt Length (20 Default)"), keltmult = input(1.0, title='Kelt Multiple')
keltsrc = src, ma = ema(keltsrc, length), range = useTrueRange ? tr : high - low, rangema = ema(range, keltlength)
upperkelt = ma + rangema * keltmult, lowerkelt = ma - rangema * keltmult

// !<----- Plotting -------- > 
upperBB = plot(upper, transp=0, color=color.white, linewidth=2,offset=offset, title="Upper BBand (2 St Dev Default)")
lowerBB = plot(lower, transp=0, color=color.white,linewidth=2, offset=offset, title="Lower BBand (2 St. Dev Default)")
u = plot(upperkelt, color=color.white, title="Upper Keltner Channel"), l = plot(lowerkelt, color=color.white, linewidth=1, title="Lower Keltner Channel")
plot(basis, transp=0,linewidth=2, color=color.red, title="Bollinger Basis (20MA Default)"), plot(ma, color=color.red, title="Keltner Basis")
fill(u, l, color=color.aqua, transp=80, title='Keltner Channel Fill'), fill(upperBB, lowerBB, color=color.aqua,transp=80, title="BBand Fill")
// [/pine]

For information regarding the calculation and use of Bollinger Bands or Keltner Channels, the resources provided here on Tradingview are available by searching in the toolbar above.
Informacje o Wersji:
Logarithmic Fix
Informacje o Wersji:
Upgrading script from pine v4 to pine v5

Eric Thies
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?