with ability to change first to a different Time Frame.(Defaults To Current Chart Time Frame).
Ability To Turn On/Off Background Highlighting if First is Above/Below 70 or 30 Lines.
Ability To Turn On/Off Background Highlighting When First Crosses Above 30 Or Below 70.
Ability To Turn On/Off "B" Or "S" When First Crosses Above 30 Or Below 70.
Ability To Turn On/Off Mid -Line Plot.
Option To Plot 2nd to show different Time Frames on same chart!!!
Ability To Use Different Look Back Period If You Plot 2nd .
//Created By ChrisMoody on 8/15/2014 ///RSI with ability to change first RSI to a different Timeframe. //option to Plot 2nd RSI to show different Timeframes on same chart study(title="CM_Ultimate RSI MTF", shorttitle="CM_Ult_RSI_MTF", precision=0) src = close len = input(14, minval=1, title="Length") upLine = input(70, minval=50, maxval=90, title="Upper Line Value?") lowLine = input(30, minval=10, maxval=50, title="Lower Line Value?") sml = input(true, title="Show Mid Line?") sbh = input(true, title="Show Back Ground Highlights When RSI is Above/Below High/Low Lines?") sch = input(true, title="Show Back Ground Highlights When RSI Cross?") sl = input(true, title="Show 'B' and 'S' Letters When RSI Crosses High/Low Line?") useCurrentRes = input(true, title="Use Current Chart Resolution?") resCustom = input(title="Use Different Timeframe? Uncheck Box Above", type=resolution, defval="60") ssRSI = input(false, title="Show 2nd RSI?") resCustom2 = input(title="Use 2nd RSI? Check Box Above", type=resolution, defval="D") useCurrentRes2 = input(false, title="Use 2nd RSI Plot On Samet Timeframe?") len2 = input(14, minval=1, title="2nd RSI Length") res = useCurrentRes ? period : resCustom res2 = useCurrentRes2 ? period : resCustom2 up = rma(max(change(src), 0), len) down = rma(-min(change(src), 0), len) rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down)) outRSI = security(tickerid, res, rsi) up2 = rma(max(change(src), 0), len2) down2 = rma(-min(change(src), 0), len2) rsi2 = down2 == 0 ? 100 : up2 == 0 ? 0 : 100 - (100 / (1 + up2 / down2)) outRSI2 = security(tickerid, res2, rsi2) aboveLine = outRSI > upLine ? 1 : 0 belowLine = outRSI < lowLine ? 1 : 0 crossUp = outRSI < lowLine and outRSI > lowLine ? 1 : 0 crossDn = outRSI > upLine and outRSI < upLine ? 1 : 0 bgcolor(sbh and aboveLine ? red : na, transp=70) bgcolor(sbh and belowLine ? green : na, transp=70) bgcolor(sch and crossUp ? lime : na, transp=40) bgcolor(sch and crossDn ? red : na, transp=40) plot(outRSI, title="RSI", style=line, linewidth=3, color=aqua) plot(ssRSI and outRSI2 ? outRSI2 : na, title="2nd RSI - Different Time Frame?", style=linebr, linewidth=4, color=orange) 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", char='B', location=location.bottom, color=lime, transp=0, offset=0) plotchar(sl and crossDn ? crossDn : na, title="Sell Signal", char='S', location=location.top, color=red, transp=0, offset=0) fill(p1, p2, color=silver, transp=70)
This script help me to think very clean & clear how to use RSI efficiently man! combine with support & resistance & other EMA i'm ready to swim!
1- Long put strategy 5min TF, use when it oversold & cross down green line 30 with highlighted green bar shows before the clear green pop up.
2. for long call reverse this strategy at 70 line.
3. Take profit when pocket $$$ enough. dont wait till it touch to the next support-buy entry / resistance-sell entry. :)
Thank you Chris! this is awesome!!
Thanks for your script.
Yet, when used with lower time frame, this script records the last value of the outRSI2 (value of the last lower time frame bar) once the higher time frame closes. The other internal lower time frames outRSI2 are not recorded.
I wonder, is it possible to record each lower time frame close of the outRSI2 within the higher time frame? Further, is it possible to define 2 variables that one of them records higher values of outRSI2 and the other records lower values of the outRSI2 with respect to their preceding bar?
Suppose I am using 1H (the higher time frame) chart and 15m as my lower time frame for the outRSI2. Now, there should be, obviously, a total of 4 records of outRSI2. Further, this outRSI2, within the 15 minutes time frame, may have, for example: 45 (last close) 50 60 55 70. In this example, we have 3 values of outRSI2 that are greater than their previous outRSI2 bar and of course 1 outRSI2 bar that is less (or equal) than its preceding bar.
So, I would like to know how these values of outRSI2 can be recorded (and plotted).
Thanks a lot.