Re: RSI Indicators for MT4

1651
This experimental study attempts to translate Relative Strength Index ( RSI ) threshold levels of oversold/overbought and bull/bear zones as probable Price Support and Resistance levels.
Could this be translated into an MT4 Indicator?


Code: Select all

//@version=4
study('RSI Support & Resistance by DGT', 'RSI S&R ʙʏ DGT ☼☾', true)

i_source       = input("Price (close)", 'Source', options = ["Price (close)", "On Balance Volume (OBV)"], inline = 'RSI', group = 'RSI Settings')
i_length       = input(14, '  Length' , minval=1                                                        , inline = 'RSI', group = 'RSI Settings')
i_obThreshold  = input(70, 'Overboght', minval=50, maxval=100, inline = 'Thresh1', group = 'Threshold Settings') 
i_bullZone     = input(60, 'Bull Zone', minval=50, maxval=65 , inline = 'Thresh1', group = 'Threshold Settings') 
i_bearZone     = input(40, 'Bear Zone', minval=35, maxval=50 , inline = 'Thresh2', group = 'Threshold Settings')  
i_osThreshold  = input(30, 'Oversold' , minval=1 , maxval=50 , inline = 'Thresh2', group = 'Threshold Settings')  

i_owcb         = input(true , 'RSI Weighted Colored Bars'    , group = 'Optional')
i_obos         = input(false, 'RSI Overbought/Oversold Marks', group = 'Optional')
i_fill         = input(true , 'Backgroud of Bull/Bear Zones' , group = 'Optional')

// Functions ════════════════════════════════════════════════════════════════════════════════════ //

f_getPrice(_osc, _thresh, _cross) =>
    avgHigh = avg(high, close)
    avgLow  = avg(low , close)
    
    var return = 0.

    if _cross == 'over'  or _cross == 'both'
        if crossover(_osc, _thresh)
            return := avgHigh
    if _cross == 'under' or _cross == 'both'
        if crossunder(_osc, _thresh)
            return := avgLow
    return

// -Calculations ════════════════════════════════════════════════════════════════════════════════ //

oscillator            = rsi(i_source == "Price (close)" ? close : obv, i_length)
crossover_overbought  = f_getPrice(oscillator, i_obThreshold, 'over' )
crossunder_overbought = f_getPrice(oscillator, i_obThreshold, 'under')
bullZone              = f_getPrice(oscillator, i_bullZone   , 'both' )
bearZone              = f_getPrice(oscillator, i_bearZone   , 'both' )
crossover_oversold    = f_getPrice(oscillator, i_osThreshold, 'over' )
crossunder_oversold   = f_getPrice(oscillator, i_osThreshold, 'under')

// -Plotting ════════════════════════════════════════════════════════════════════════════════════ //

plot_crossover_overbought  = plot(crossover_overbought  > 0 ? crossover_overbought  : na, 'Crossover Overbought' , crossover_overbought  == crossover_overbought[1]  ? color.green : na, 2)
plot_crossunder_overbought = plot(crossunder_overbought > 0 ? crossunder_overbought : na, 'Crossunder Overbought', crossunder_overbought == crossunder_overbought[1] ? color.green : na, 1, plot.style_cross)
plot_bullZone              = plot(bullZone              > 0 ? bullZone              : na, 'Cross Bull Zone'      , bullZone              == bullZone[1]              ? color.green : na, 1)

fill(plot_crossover_overbought, plot_bullZone, i_fill ? color.green : na)
plotshape(i_obos and oscillator > i_obThreshold, "Price Bars in Overbought Zone", shape.triangledown, location.abovebar, color.red, size=size.tiny)

plot_bearZone            = plot(bearZone            > 0 ? bearZone            : na, 'Cross Bear Zone'    , bearZone            == bearZone[1]            ? color.red : na, 1)
plot_crossover_oversold  = plot(crossover_oversold  > 0 ? crossover_oversold  : na, 'Crossover Oversold' , crossover_oversold  == crossover_oversold[1]  ? color.red : na, 1, plot.style_cross)
plot_crossunder_oversold = plot(crossunder_oversold > 0 ? crossunder_oversold : na, 'Crossunder Oversold', crossunder_oversold == crossunder_oversold[1] ? color.red : na, 2)

fill(plot_crossunder_oversold, plot_bearZone, i_fill ? color.red : na)
plotshape(i_obos and oscillator < i_osThreshold, "Price Bars in Oversold Zone", shape.triangleup, location.belowbar, color.green, size=size.tiny)

barcolor(i_owcb ? oscillator > i_obThreshold or oscillator < i_osThreshold ? close < open ? #910000      : #006400 : 
                  oscillator > i_bearZone    and oscillator < i_bullZone   ? close < open ? color.orange : #7FFFD4 : na : na, title="RSI Weighted Colored Bars")

// -Alerts   ════════════════════════════════════════════════════════════════════════════════════ //

alertcondition(crossover (close, crossover_overbought), "Crossover Previous Overbought", "Crossover Previous Overbought\n{{exchange}}:{{ticker}}->\nPrice = {{close}},\nTime = {{time}}")
alertcondition(crossunder(close, crossunder_oversold ), "Crossunder Previous Oversold" , "Crossunder Previous Oversold\n{{exchange}}:{{ticker}}->\nPrice = {{close}},\nTime = {{time}}")


Re: RSI Bands Fabs

1654
ionone wrote: Wed Aug 18, 2021 9:32 pm I played around a bit with the algorithm and came up with this version. Which is totally different from previous version 01

might be of use, looks good ! especially the bottom one which nails the tops and bottoms

first settings is : 20,20,false,7
second settings is : 20,20,true,-7

EDIT : this is experimental, no guarantee !
Jeff and Josi this is interesting. Check out these standard RSI settings, it creates a bit of a channel and although not as rapid, gives us some nice reversal points.

  • RSI Period: 14
  • MA Period: 20
  • invBands: False

Here's a template below. What do you think? :think:
These users thanked the author Jimmy for the post (total 3):
josi, whiplashtm, sal
Are you looking for a Forex broker? FBS cuts spreads by up to 58%. Click here to begin your trading journey, today.
No commissions are earned by Forex-station.


Guide to the "All Averages" Filters (ADXvma, Laguerre etc.) 🆕
Use Fibonacci numbers for indicator settings + How to draw Fibonacci Extensions
An easy trick for drawing Support & Resistance

Re: RSI Indicators for MT4

1655
Hi!
I'm just wondering if we could have these interesting indicators, coded by mladen, updated with the latest averages and prices (and maybe some general cleanup)?
But to make the indicator even more interesting in terms of tweaking and getting different results, could we also have the option to change the average-type for each individual average?

Have a pleasent day!


Re: RSI Indicators for MT4

1656
whiplashtm wrote: Thu Aug 19, 2021 11:52 pm Hi!
I'm just wondering if we could have these interesting indicators, coded by mladen, updated with the latest averages and prices (and maybe some general cleanup)?
But to make the indicator even more interesting in terms of tweaking and getting different results, could we also have the option to change the average-type for each individual average?

Have a pleasent day!
Try.
These users thanked the author mrtools for the post (total 10):
Jimmy, 太虚一毫, Milad8732, whiplashtm, Lumios, RodrigoRT7, MaxTorque, pipsquirrel, alexm, Jedidiah

Re: RSI Indicators for MT4

1658
talaate wrote: Mon Aug 23, 2021 7:13 am Hi mrtools
would you please add alerts for the given indicator when:
1) the two signal cross each other up or down
2) when RSI 50 cross up or down (i.e. histo bar shows blue or red)
and if possible the set of averages
In case the original is missed, I sent it in PM box as this is forex station stuff
Rsi - histo (mtf).ex4
Added the averages and alerts.
These users thanked the author mrtools for the post (total 7):
太虚一毫, vvFish, talaate, Zalmoxis, Skyold, pipsquirrel, alexm


Who is online

Users browsing this forum: Bing [Bot], Jimmy, losajoca, Majestic-12 [Bot], moey_dw and 104 guests