ChrisMoody

CM Willams %R and CCI BackGround Highlight

CM_Willams %R and CCI BackGround Highlight

Created By User Request

Indicator Highlights:

Creates Red BackGround Highlight if CCI Or Williams %R are Above Upper Line (User Defined)

Creates Green BackGround Highlight if CCI Or Williams %R are Below Lower Line (User Defined)

Ability to Turn On/Off either Williams %R or CCI Highlights in Inputs Tab via Check Boxes.

Ability To Set All Parameters for CCI and Williams %R in Inputs Tab.

Ability to Set High/Low “Threshold” Lines for Both CCI and Williams %R in Inputs Tab.

***I was asked if you could plot Back Ground Highlights on Two Individual Indicators AND have it show if BOTH Indicators were Overbought and Oversold.
***The answer is Yes. On the Chart Above I have the same Shade of Red and Green for Both Indicators. However, you will notice when Both Indicators Show OverBought…Both Plot Red Back Ground Highlights Which = a Brighter Red. The same is True for Oversold Conditions. The Green Shows a Brighter Shade of Green.

***VERY IMPORTANT - It is difficult for a programmer to release Indicators with this feature because depending on what color background you use on your charts…THE COLORS LOOK COMPLETELY DIFFERENT. So If You Don’t Use The Black Back Ground Shown Above You Most Likely Will Need To Adjust The Transparency, and Possibly The Colors Themselves!!!!

Reference Page
www.tradingview.com/v/UmsFo3hv/

오픈 소스 스크립트

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

면책사항

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

차트에 이 스크립트를 사용하시겠습니까?
//Created by ChrisMoody on 10-17-2014 by user request.

study(title="CM_Willams %R and CCI BackGround Highlight", shorttitle="CM_%R and CCI", overlay=true)
length = input(21, minval=1, title="Williams %R Length")
willTL = input(10, minval=5, maxval=95, title="Williams %R Trigger Lines, 20 Converts to -20,-80...10 = -10,-90 etc.")
length2 = input(30, minval=1, title="CCI Length")
cciT = input(200, minval=50, maxval=200, title="CCI Trigger Lines, Converts to +100,-100 - +200,-200 etc.")
scci = input(true, title="Show CCI BackGround Highlight")
swill = input(true, title="Show Williams %R BackGround Highlight")
//CCI Code
ma = sma(close, length2)
cci = (close - ma) / (0.015 * dev(close, length2))
cciTA = 0 + cciT
cciTB = 0 - cciT
//CCI Criteria Definitions
cciA = cci > cciTA ? 1 : 0
cciB = cci < cciTB ? 1 : 0
//CCI Color Plots
condCCI = scci and cciA ? red : scci and cciB ? lime : na 
//Williams %R Definitions
upper = highest(length)
lower = lowest(length)
//Williams %R Criteria
willR = 100 * (close - upper) / (upper - lower)
willRAbove = willR > (0 - willTL) ? 1 : 0
willRBelow = willR < (-100 + willTL) ? 1 : 0
//Williams %R Color Definitions
condWill = swill and willRAbove ? red : swill and willRBelow ? lime : na

//Background Highlights
bgcolor(condCCI, transp=70)
bgcolor(condWill, transp=70)