ChrisMoody

CM_Stochastic Highlight Bars

צפיות ‎12903‎
3882
12903 18
CM_Stoch Highlight Bars

belgusinc Wanted to Know How To Create Highlight Bars based on Stochastic Bars Being Overbought/Oversold

Basics:
Ability to turn On/Off Crosses Only Above or Below High/Low Lines.
User sets Values Of High/Low lines. (Determines how highlight Bars are plotted, Based on the Value of the 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.

Lower Indicator
הסר מסקריפטים מועדפים הוסף לסקריפטים מועדפים
//Created by ChrisMoody on October 23, 2014 by user request - belgusinc
//Changes Barcolor when Stochastic is Overbought Oversold.

//Necessary for Highlight Bars
//Only Necessary if you want you want Stochastic Croses
study(title="CM_Stochastic_Highlight Bars", shorttitle="CM_Stoch_HighlightBars", overlay=true)
len = input(14, minval=1, title="Length for Stochastic") 
smoothK = input(3, minval=1, title="SmoothK for Stochastic")
smoothD = input(3, minval=1, title="SmoothD for Stochastic")
upLine = input(80, minval=50, maxval=90, title="Upper Line Value?")
lowLine = input(20, minval=10, maxval=50, title="Lower Line Value?")

//Not Necessary, In Inputs Tab, capability to turn On/Off Highlight Bars, and Both Crosses
//These are all checkboxes in inputs tab....Show Barcolor Highlights, Show Background Hghlight, Plot B and S for Buy Sell 
sbc = input(true, title="Show Price Bar highlight When Stoch is Above/Below High/Low Lines?")
sbh = input(false, title="Show Background highlight When Stoch is Above/Below High/Low Lines?")
sch = input(false, 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?")

//Necessary for Highlight Bars
//Stoch formula
k = sma(stoch(close, high, low, len), smoothK)
d = sma(k, smoothD)

//Necessary for Highlight Bars
//aboveline = OverBought, belowline = Oversold Definitions
aboveLine = k > upLine ? 1 : 0
belowLine = k < lowLine ? 1 : 0

//Only Necessary if you want you want Stochastic Croses
//Definition for Cross when Above High-Low lines
crossUp = (k[1] < d[1] and k[1] < lowLine[1]) and (k > d)  ? 1 : 0
crossDn = (k[1] > d[1] and k[1] > upLine[1]) and (k < d) ? 1 : 0

//Only Necessary if you want you want Stochastic Croses
//Definition for Cross that doesn't have to be above or below High and Low line.
crossUpAll = (k[1] < d[1] and k > d) ? 1 : 0
crossDownAll = (k[1] > d[1] and k < d) ? 1 : 0

//Only Necessary if you want background Highlighting also - Take out the sbh/sbc and part
//BackGround Highlights based on Above/Below Lines, Strict Cross Up/Down
//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)

//Only Necessary if you want background Highlighting also
//plots bgcolor Cross with no filter
bgcolor(sac and crossUpAll ? lime : na, transp=40)
bgcolor(sac and crossDownAll ? red : na, transp=40)

//Necessary for Highlight Bars
//Highlight Bar Definitions
overBought() => sbc and aboveLine 
overSold() => sbc and belowLine 

//Necessary for Highlight Bars
//Highlight Bar Plot Statement based on Above Definitions
barcolor(overBought() ? orange : overSold() ? fuchsia : na)

//Not Necessary if you just want Highlight Bars  - Extra Feature
//These are just the Letters B and Sell Based on Crosses
plotchar(sl and crossUp ? crossUp : na, title="Buy Signal Strict Criteria", char='B', location=location.belowbar, color=lime, transp=0, offset=0)
plotchar(sl and crossDn ? crossDn : na, title="Sell Signal Strict Criteria", char='S', location=location.abovebar, color=red, transp=0, offset=0)
plotchar(sacl and crossUpAll ? crossUpAll : na, title="Buy Signal Any Cross Up", char='B', location=location.belowbar, color=lime, transp=0, offset=0)
plotchar(sacl and crossDownAll ? crossDownAll : na, title="Sell Signal Any Cross Down", char='S', location=location.abovebar, color=red, transp=0, offset=0)

רעיונות קשורים

dear chris how can i add the 2day and 3 day option to it because i now can only choose 1day and week ? kindest regards
השב
bartgevers013 bartgevers013
@bartgevers013, and is there an option that i buy this same stoch from you with the 30 min ,1 hour, 2hour, 3 hour , 4 hour , 6 hour and 1 day and 2 day and 3 day dtoch option . so i mean 1 indicator block with 9 stoch line options at the same time ? this would be really great ;-)
השב
Incredible work - thank you for this Chris!
השב
This is a nice indicator. I'm wondering why the signals are messed up in replay mode. A repaint issue?
+1 השב
TensorTom TensorTom
Actually, it was the MTF version I was referring to. Probably the security function.
השב
you rock chris moody.
השב
Hey Chris...Are you able to code this indicator to work in conjunction with your CM_Stoch_MTF?

So if CM_Stoch_MTF is set to display 14,3,3 on a 2H chart and on the smaller time-frame, then if CM_Stoch Highlight Bars was to have the same MTF function we could sync both indicators to show buy/sell signals on let's say on a 15 minute chart...

Thanks in advance for any thoughts and feedback you are able to offer....
+1 השב
Chris, can me make a new indicator using the foundation of what you have created here. I would like to see the price bars colored depending on the "phase of cycle" of the Double Smoothed Stochastic indicator tool. If you can imagine this....DSS with all three speeds set to the same setting....24 for example, so 24,24,24. Much easier to see what phase cycle price is undergoing using the stochastic tools in this manner. In phase being when both stochastic oscillator values are in agreement. So the result I would like to see is the obvious, both stochastic values are in agreement upward (positive cross) would be Green, both stochastic in agreement downward (negative cross) would be Red, all else could be grey. If possible, we could have the element of adding the filter, 50 center line cross as well. Thanks !!!
השב
ChrisMoody coondawg71
When you say Both Stochastics...are you saying the DSS? Or The DSS AND the regular Stochastic listed at the top of this post?
השב
coondawg71 ChrisMoody
thanks for the reply, sorry, i see now how that could be confusing. Just DSS, "both" meaning when the DSS crosses take place; setup in this fashion puts both Stochastic values (the K and the D) in agreement, the D obviously lagging from smoothness. Hope that explains it better. Thank You!
השב
בית סורק מניות סורק מט"ח סורק מטבעות-קריפטו יומן כלכלי סדרות איך זה עובד‏ תכונות גרף מחירון חוקי הבית מנהלים כלים לאתרים וברוקרים יישומונים פתרונות גרפיים ספריית גרפים קלי משקל מרכז תמיכה הפנה חבר בקשת פונקציה בלוג וחדשות שאלות נפוצות ויקי טוויטר‏
פרופיל הגדרות פרופיל חשבון וחיוב הפנה חבר לשוניות התמיכה שלי מרכז תמיכה רעיונות שפורסמו עוקבים עוקב אחרי... הודעות פרטיות צ'אט התנתק