Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Modified by Ivan Labrie on 04-11-2015
- //Created by ChrisMoody on 10-17-2014 by user request.
- study(title="CCI OB and OS signals", shorttitle="CCI OB and OS", overlay=true)
- length2 = input(11, minval=1, title="CCI Length")
- cciT = input(100, minval=50, maxval=200, title="CCI Trigger Lines, Converts to +100,-100 - +200,-200 etc.")
- scci = input(true, title="Show CCI 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 ? green : scci and cciB ? red : na
- //Background Highlights
- bgcolor(condCCI, transp=50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement