CapnOscar

CapnsBandsV2

Here is the 2nd version of CapnsBandsV2 for Mateys... Remind you this a trend indicator NOT a BUY and SELL. Its up to you how you read it. Defaults for Smaller TF like 15Mnts. Enjoy it. :)
Remove from Favorite Scripts Add to Favorite Scripts
//Coded by CapnOscar on 16.04.2015 - Say Thanks?
study(shorttitle="CapnsBBV2", title="CapnsBandsV2", overlay=true)

//Define Variables
max = 80
hi = 70
mup = 50.5
mdo = 49.5
lo = 30
min = 20

//MiniTrend
src1 = close, len1 = input(21, minval=1, title="MiniTrend RSI")
up1 = rma(max(change(src1), 0), len1)
down1 = rma(-min(change(src1), 0), len1)
rsi1 = down1 == 0 ? 100 : up1 == 0 ? 0 : 100 - (100 / (1 + up1 / down1))

//MajorTrend
src2 = close, len2 = input(84, minval=1, title="MajorTrend")
up2 = rma(max(change(src2), 0), len2)
down2 = rma(-min(change(src2), 0), len2)
rsi2 = down2 == 0 ? 100 : up2 == 0 ? 0 : 100 - (100 / (1 + up2 / down2))
rsi2c = rsi2 > mup ? lime : rsi2 < mdo ? red : rsi2 == 50 ? aqua : aqua

// paint candles according rsicrossings
pb = input(title="Paint Bars", type=bool, defval=true)
barcolor(pb and rsi2 > mup ? close > open ? lime : green : pb and rsi2 < mdo ? close > open ? red : maroon : close > open ? aqua : navy)

//TakeProfit Its not ready yet will Check later
//signb = iff(rsi2 < mdo and rsi1[1] < lo and rising(rsi1, 1), low, na)
//plb = plotshape(signb, style=shape.triangleup, location=location.belowbar, color = green, textcolor = green, text="$" )

// Paint CapnsBands
BBlength = input(80, minval=1)
src = input(close, title="Source")
mult = input(2.0, minval=0.001, maxval=50)
basis = sma(src, BBlength)
dev = mult * stdev(src, BBlength)
upper = basis + dev
lower = basis - dev
p0 = plot(basis, linewidth=3, color=rsi2c)
p1 = plot(upper, color=green)
p2 = plot(lower, color=red)
fill(p1, p0, color=green, transp=95)
fill(p0, p2, color=red, transp=95)

Related Ideas

English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体中文
繁體中文
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