kingthies

KBC

kingthies 업데이트됨   
KBC combines the logarithmic bollinger bands with keltner channels.
릴리즈 노트:
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.
릴리즈 노트:
Logarithmic Fix
릴리즈 노트:
Upgrading script from pine v4 to pine v5

Eric Thies
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?