blindfreddy

RSI-Stochastic Hybrid v2

**For those who like a smooth ride...v2 of this script is now updated with optional exponential averaging of the stochastic and RSI. So for instance a value of 3 for smoothing of the stochastic is like using %D instead of %K. **
This is a very simple idea - an average of RSI and the Stochastic Oscillator. However it offers plenty of flexibility for tuning to your requirements. You can change the lengths of either indicator and the weighting of each. By default it's set to 50/50 (just change the percent RSI to adjust). There is also an optional EMA which can be used as a signal line.
This idea comes from Greg Morris who likes to use it for trend following. I would buy when the indicator hits the overbought line and sell when it goes below 50.

סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יכולים להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.

רוצה להשתמש בסקריפ זה בגרף?
//Scripted by Blind Freddy
//See my blog at http://blindfreddy.postagon.com for learning and picks
//Hybrid RSI-Stochastic Indicator v2, with optional smoothing and EMA line
study(title="RSI-Stoch Hybrid v2", shorttitle="RSI-Stoch", overlay=false)
len = input(14, minval=1, title="RSI Length")
lenRSIsmth = input(3,minval=1, title = "RSI Smoothing")
lenstoch = input(26, minval=1, title="Stochastic Length")
lenStochsmth = input(3,minval=1, title = "Stoch Smoothing")
thepercent = input(50, minval=0, maxval = 100, title="Percent RSI")
len2 = input(5, minval=1, title="EMA (Signal) Length")
thersi= ema(rsi(close,len),lenRSIsmth)
thestoch=ema(stoch(close,high,low,lenstoch),lenStochsmth)
thehybrid=thersi*thepercent/100 + thestoch*(100-thepercent)/100
theEMA = ema(thehybrid,len2)
plot(thehybrid, title="RSI-Stoch Hybrid", style=line, linewidth=2, color=teal)
plot(theEMA, title="EMA", style=line, linewidth=2, color=gray)
band2 = hline(80, title="Upper Line", linestyle=dashed, linewidth=1)
band1 = hline(50, title="Upper Line", linestyle=dashed, linewidth=1)
band0 = hline(20, title="Lower Line", linestyle=dashed, linewidth=1)
fill(band2, band0, color=blue, transp=90)

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