Relative Strength Index with Range Shift

Forums ProRealTime English forum ProBuilder support Relative Strength Index with Range Shift

  • This topic has 5 replies, 2 voices, and was last updated 2 years ago by avataryas.
Viewing 6 posts - 1 through 6 (of 6 total)
  • #204166
    yas
    Can this code be converted into Pro Real Time please if possible this indicator was in tradingview
    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © kevindcarr
    //@version=5
    indicator(title=’Relative Strength Index with Range Shift’, shorttitle=’RSI’, overlay=false, precision=1)
    var table conditionTable = table.new(position=position.top_right, columns=1, rows=1)
    log = input.string(title=’Scale’, options=[‘Logarithmic’, ‘Regular’], defval=’Logarithmic’)
    range_1 = input.string(title=’Range Bias’, options=[‘Bullish’, ‘Strong Bullish’, ‘Bearish’, ‘Strong Bearish’, ‘No Bias’], defval=’Bullish’)
    lookbackPeriod = input(title=’Lookback Period’, defval=14)
    source = input(title=’Source’, defval=close)
    rangeShift(range_2) =>
        if range_2 == ‘Bullish’
            [40, 60, 80]
        else if range_2 == ‘Strong Bullish’
            [45, 65, 85]
        else if range_2 == ‘Bearish’
            [35, 55, 75]
        else if range_2 == ‘Strong Bearish’
            [30, 50, 70]
        else
            [40, 60, 80]
    condition(rsi, range_3) =>
        [lo, mid, hi] = rangeShift(range_3)
        if rsi <= lo
            [color.green, ‘Very Oversold’]
        else if rsi <= mid
            [color.yellow, ‘Oversold’]
        else if rsi <= hi
            [color.orange, ‘Overbought’]
        else
            [color.red, ‘Very Overbought’]
    rsiSource = (log == ‘Logarithmic’ ? math.log(source) : source)
    rsi = ta.rsi(rsiSource, lookbackPeriod)
    [col, txt] = condition(rsi, range_1)
    table.cell(conditionTable, 0, 0, text=txt, bgcolor=col)
    plot(series=rsi, title=’Relative Strength Index’, color=col)
    #204191
    yas

    hi guys

    can the above code can be converted into pro real time please if possible

    many thanks

    #204196

    ok, but you know that’s a classic RSI with 3 different colors shades, right?

    #204197
    yas

    yes thats correct

    #204214

    Well ok, here it is. Change the “range bias” with a number in the settings at top of the code:

     

    #204216
    yas

    Thank you very much appreciated your help thanks again

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login