Super Stoch

This is a multi-time frame Stoch RSI based on Chris Moody's "CM_Stochastic_MTF". Changes are primarily cosmetic and the "stock" signal and Stoch RSI calculations are retained.
Remove from Favorite Scripts Add to Favorite Scripts
//  Originally scripted by ChrisMoody on October 23, 2014 for user platinumFX
//  Retooled by Quicksilver
study(title="Super Stoch", shorttitle="Super Stoch")

// Upper, Middle, and Lower line display options
sml = input(true, title="Show Mid Line?")
upLine = input(80, minval=50, maxval=90, title="Upper Line")
lowLine = input(20, minval=10, maxval=50, title="Lower Line")

// Strict signal display options
sch = input(true, title="Show background highlights on strict crossings?")
sl = input(true, title="Show 'B' and 'S' on strict crossings?")

// General signal display options
sbh = input(false, title="Show background highlights when Stoch is Overbought/Oversold?")
sac = input(false, title="Show background highlightss on any crossings?")
sacl = input(false, title="Show 'b' and 's' on any crossings?")

//  Stoch 1
len = input(14, minval=1, title="Stoch1 Len") 
smoothK = input(3, minval=1, title="Stoch1 K")
smoothD = input(3, minval=1, title="Stoch1 D")
res = input(title="Stoch1 Resolution", type=resolution, defval="120")
//  Stoch 1 formula
k = sma(stoch(close, high, low, len), smoothK)
d = sma(k, smoothD)
outK = security(tickerid, res, k)
outD = security(tickerid, res, d)

// Stoch 2
ssStoch = input(true, title="Show Stoch2 ?")
useCurrentRes2 = input(false, title="Use current timeframe For Stoch2 ?")
resCustom2 = input(title="Stoch2 Resolution", type=resolution, defval="D")
len2 = input(14, minval=1, title="Stoch2 Len")
smoothK2 = input(3, minval=1, title="Stoch2 K")
smoothD2 = input(3, minval=1, title="Stoch2 D")
res2 = useCurrentRes2 ? period : resCustom2
//  Stoch2 formula
k2 = sma(stoch(close, high, low, len2), smoothK2)
d2 = sma(k2, smoothD2)
outK2 = security(tickerid, res2, k2)
outD2 = security(tickerid, res2, d2)

//  Signal definitions
aboveLine = outK > upLine ? 1 : 0
belowLine = outK < lowLine ? 1 : 0
crossUp = (outK[1] < outD[1] and outK[1] < lowLine[1]) and (outK > outD)  ? 1 : 0
crossDn = (outK[1] > outD[1] and outK[1] > upLine[1]) and (outK < outD) ? 1 : 0
//Definition for Cross that doesn't have to be above or below High and Low line.
crossUpAll = (outK[1] < outD[1] and outK > outD) ? 1 : 0
crossDownAll = (outK[1] > outD[1] and outK < outD) ? 1 : 0

// BackGroound Color Plots
bgcolor(sbh and aboveLine ? red : na, transp=80)
bgcolor(sbh and belowLine ? lime : na, transp=80)
bgcolor(sch and crossUp ? lime : na, transp=80)
bgcolor(sch and crossDn ? red : na, transp=80)
//plots for Cross with no filter
bgcolor(sac and crossUpAll ? lime : na, transp=80)
bgcolor(sac and crossDownAll ? red : na, transp=80)
//Plot Stoch1
plot(outK, title="Stoch K", style=line, linewidth=1, color=orange)
plot(outD, title="Stoch D", style=line, linewidth=1, color=blue)
// Plot Stoch2
plot(ssStoch and outK2 ? outK2 : na, title="K2", style=line, linewidth=1, color=red)
plot(ssStoch and outD2 ? outD2 : na, title="D2", style=line, linewidth=1, color=green)

p1 = plot(upLine, title= "Upper Line", style=solid, linewidth=1, color=gray)
p2 = plot(lowLine, title= "Lower Line", style=solid, linewidth=1, color=gray)
plot(sml and 50 ? 50 : na, title="Mid Line", style=linebr, linewidth=1, color=gray)
plotchar(sl and crossUp ? crossUp : na, title="Strict Buy", char='B', location=location.bottom, color=lime, transp=0, offset=0)
plotchar(sl and crossDn ? crossDn : na, title="Strict Sell", char='S', location=location.top, color=yellow, transp=0, offset=0)
plotchar(sacl and crossUpAll ? crossUpAll : na, title="Any Buy", char='b', location=location.bottom, color=blue, transp=0, offset=0)
plotchar(sacl and crossDownAll ? crossDownAll : na, title="Any Sell", char='s', location=location.top, color=red, transp=0, offset=0)
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
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