ChrisMoody

CM Stochastic Multi-TimeFrame

Multi TimeFrame Stochastic Loaded With Features.

Basics:
Ability to turn On/Off Crosses Only Above or Below High/Low Lines.
User sets Values Of High/Low lines.
Ability to turn On/Off All Crosses, Both BackGround Highlights and “B”, “S” Letters.
Ability to turn On/Off BackGround Highlights if Stoch is Above Or Below High/Low Lines.
Ability to All or Any Combination of these Features.

Multi Timeframe Capabilities:
Stoch defaults to current timeframe. You can change to many other timeframes.
Ability to turn On/Off Plotting 2nd Stoch on same TimeFrame with different settings
Ability to turn On/Off Plotting 2nd Stoch on Different TimeFrame

Much More…All Inputs and Options are Adjustable in Inputs Tab.
Remove from Favorite Scripts Add to Favorite Scripts
//Created by ChrisMoody on October 23, 2014 by user request - platinumFX
//Defaults to current timeframe Ability to change to different timeframe, or plot two RSI's on different timeframes.
study(title="CM_Stochastic_MTF", shorttitle="CM_Stoch_MTF")
len = input(14, minval=1, title="Length for Main Stochastic") 
smoothK = input(3, minval=1, title="SmoothK for Main Stochastic")
smoothD = input(3, minval=1, title="SmoothD for Main Stochastic")
upLine = input(80, minval=50, maxval=90, title="Upper Line Value?")
lowLine = input(20, minval=10, maxval=50, title="Lower Line Value?")
sml = input(true, title="Show Mid Line?")
sbh = input(false, title="Show Back Ground Highlights When Stoch is Above/Below High/Low Lines?")
sch = input(true, title="Show Back Ground Highlights When Stoch Cross - Strict Criteria - K Greater/LesThan High/Low Line - Crosses D ?")
sl = input(true, title="Show 'B' and 'S' Letters When Stoch Crosses High/Low Line & D?")
sac = input(false, title="Show Back Ground Highlights When Stoch Cross - Any Cross?")
sacl = input(false, title="Show 'B' and 'S' Letters When Stoch Crosses - Any Cross?")
useCurrentRes = input(true, title="Use Current Chart Resolution?")
resCustom = input(title="Use Different Timeframe? Uncheck Box Above", type=resolution, defval="60")
ssStoch = input(false, title="Show 2nd Stoch?")
resCustom2 = input(title="Use 2nd Stoch? Check Box Above", type=resolution, defval="D")
useCurrentRes2 = input(false, title="Use 2nd Stoch Plot On Samet Timeframe?")
len2 = input(14, minval=1, title="2nd Stoch Length")
smoothK2 = input(3, minval=1, title="SmoothK for 2nd Stoch")
smoothD2 = input(3, minval=1, title="SmoothD for 2nd Stoch")
//Resolutioon for MTF
res = useCurrentRes ? period : resCustom
res2 = useCurrentRes2 ? period : resCustom2
//Stoch formula
k = sma(stoch(close, high, low, len), smoothK)
d = sma(k, smoothD)
outK = security(tickerid, res, k)
outD = security(tickerid, res, d)
//Optional 2nd Stoch for additional plot
k2 = sma(stoch(close, high, low, len2), smoothK2)
d2 = sma(k2, smoothD2)
outK2 = security(tickerid, res2, k2)
outD2 = security(tickerid, res2, d2)
//definitions for Cross
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=70)
bgcolor(sbh and belowLine ? lime : na, transp=70)
bgcolor(sch and crossUp ? lime : na, transp=40)
bgcolor(sch and crossDn ? red : na, transp=40)
//plots for Cross with no filter
bgcolor(sac and crossUpAll ? lime : na, transp=40)
bgcolor(sac and crossDownAll ? red : na, transp=40)
//Plot main Stochastic
plot(outK, title="Stoch K", style=line, linewidth=3, color=lime)
plot(outD, title="Stoch D", style=line, linewidth=3, color=red)
//Ability to plot 2nd Stoch
plot(ssStoch and outK2 ? outK2 : na, title="2nd Stoch K - Different TimeFrame", style=line, linewidth=3, color=orange)
plot(ssStoch and outD2 ? outD2 : na, title="2nd Stoch D - Different TimeFrame", style=line, linewidth=3, color=yellow)

p1 = plot(upLine, title= "Upper Line", style=solid, linewidth=3, color=red)
p2 = plot(lowLine, title= "Lower Line", style=solid, linewidth=3, color=lime)
plot(sml and 50 ? 50 : na, title="Mid Line", style=linebr, linewidth=2, color=gray)
plotchar(sl and crossUp ? crossUp : na, title="Buy Signal Strict Criteria", char='B', location=location.bottom, color=lime, transp=0, offset=0)
plotchar(sl and crossDn ? crossDn : na, title="Sell Signal Strict Criteria", char='S', location=location.top, color=red, transp=0, offset=0)
plotchar(sacl and crossUpAll ? crossUpAll : na, title="Buy Signal Any Cross Up", char='B', location=location.bottom, color=lime, transp=0, offset=0)
plotchar(sacl and crossDownAll ? crossDownAll : na, title="Sell Signal Any Cross Down", char='S', location=location.top, color=red, transp=0, offset=0)
fill(p1, p2, color=silver, transp=70)
Nice. Thanks Chris
Reply
Always a pleasure to get a comment from you Drat...Thanks
Reply
thanks Chris
Reply
ChrisMoody PRO FrancisFrango
Thank You,
Reply
Gratitude!
Reply
I do appreciate the comment...thanks
Reply
Spot on again! MTF is such a help and thanks Chris for sorting this for me...
Reply
Thanks...Glad you like it. I should have asked but the only variable I know I could have done better is specific criteria to plot the crosses. Should have asked you. Let me know if you need any specific criteria.
Reply
Hey guys....forgot to mention. The first Stochastic is the only one that will plot crosses and overbought oversold highlights. For example if your using a 60 minute chart...and plotting a 60 minute based Stoch and a Daily based Stoch. But you want to see the criteria highlighted on the Daily Stoch. Then make the Daily Stoch the First plot, and the 60 minute the second plot. That's a simple fix to not have to create a hundred checkboxes.
Reply
Quality things going on here! Is it possible to have such for other indicators? RSI? MACD?
Reply
Sure...but if you would have looked in the PineScript Library you would already have them.

Current MACD...but I will update this one early next week with new features.
MacD Custom Indicator-Multiple Time Frame+All Available Options!


Here is the RSI - It was recently posted so it is currently up to date.
CM_Ultimate RSI Multi Time Frame

+1 Reply
2use ChrisMoody
Strange, i look at all of your charts as i get notifications by email - must have missed the RSI one. Im sorry i should have indeed checked it, as it would be odd that you would not have RSI and make this one first :)
Reply
No problem...I've known you long enough I don't mind giving you a hard time!!!
+1 Reply
Very powerful tool. Thanks CM
Reply
ChrisMoody PRO antoineBLT87
No problem
Reply
Hey guys,

I just posted a Highlight bar based on this indicator per user request. It's not MTF but you may like in conjunction with this indicator.

CM_Stochastic Highlight Bars


snapshot
Reply
Chris, I read a lot of your stuff, you are really brilliant! I am looking for something more basic. I use just basic Stochastic with 3 different values for %K ( and have then in different colors) I have done this in MT$, Pro Real Time etc. but don't know how to add in Trading view. Can you help? This allows you to see short term pullbacks and provides some great trades when they develop. Very visual and great risk reward built in. My email is jtoptions@gmail.com..
Thanks,
JT
Reply
ChrisMoody PRO eaglenestfund
Yes...PM me next Tuesday and I will code it for you.
Reply
Thank you for this great indicator!

I'm currently using it in my swing trading strategy along with Heikin Ashi candles, pivot and Bollinger bands.. this indicator is golden for me :-)
Reply
can it be modified so that it changes color only when the cross occurs below the 80 or above the 20. Right now it colors it when the cross open while in the extreme zones (above 80 or below 20) instead of while exiting those zones.
Reply
Any way of plotting a dot, arrow, or circles on the highest highs and lowest lows of the sacl or red and green lines? Thanks.
Reply
Dear ChrisMoody, thanks for your interesting work. How could I utilize the multifimeframe in this indicator? What kind of turn on switch did you built in?
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out