[RS]CCI Price Bands V0

Request for FXBOMBER
Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]CCI Price Bands V0", overlay=true)
src = input(title='Source', type=source, defval=hlc3)
ma_length = input(title='MA length', type=integer, defval=50)
cci_length = input(title='CCI length', type=integer, defval=14)
multiplier = input(title='deviation multiplier', type=float, defval=0.01)
SHOW_OBOS = input(title='Show OB/OS Levels', type=bool, defval=false)
OBOS_lvl = input(title='CCI OB/OS Level', type=integer, defval=100)
ma = sma(src, ma_length)
cci = (src - ma) / (0.015 * dev(src, cci_length)) //100<>-100
capdev = (cum(stdev(src, 4)) / (n+1))*multiplier
//--- Optional OB/OS levels:
OBLine = ma + (capdev*OBOS_lvl)
OSLine = ma - (capdev*OBOS_lvl)
plot(not SHOW_OBOS ? na : OBLine, color=black, style=circles)
plot(not SHOW_OBOS ? na : OSLine, color=black, style=circles)

cciband = ma - (capdev*(0-cci))

plot(ma, color=black)

cci_color=cciband>ma and cciband>OBLine ? green : cciband<ma and cciband<OSLine ? maroon : gray
plot(cciband, color=cci_color, linewidth=1)

plot(cciband > OSLine and cciband < OBLine ? cciband : na, style=linebr, color=gray, linewidth=4)
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out