relative strenght by value

Forums ProRealTime English forum ProBuilder support relative strenght by value

Viewing 3 posts - 1 through 3 (of 3 total)
  • #250179
    I have tried to write the underlying code (Pinescript from TradingView) in Prorealcode but i do not succeed.
    The problem seems the way you have to have to call the S&P.
    The code works like this:
    It plots the difference between the asset in the chart corrected by an adaptable factor and the S&P.
    Could you adapt this code for Prorealtime?
    Regards
    Bert Lamoree
    //@version=5
    indicator(‘Relative Strength’, shorttitle=’RS’, timeframe=”)
    comparativeTickerId = input.symbol(‘SPX’, title=’Comparative Symbol’)
    factor = input.int(10, minval=1, title=’Period’)
    showMA = input(defval=false, title=’Show Moving Average’)
    lenghtMA = input.int(10, minval=1, title=’Moving Average Period’)
    baseSymbol = request.security(syminfo.tickerid, timeframe.period, close)
    comparativeSymbol = request.security(comparativeTickerId, timeframe.period, close)
    hline(0, color=color.black, linestyle=hline.style_dotted)

     

    res=baseSymbol*factor-comparativeSymbol
    plot(res, title=’RS’, color=color.new(#1155CC, 0))
    sma_1 = ta.sma(res, lenghtMA)
    plot(showMA ? sma_1 : na, color=color.new(color.gray, 0))
    #250185

    Hi. In indicators and backtester, you can’t reference other assets.
    Anyway, the indicator you’re trying to program is similar to the Relative Strength (Comparison) and the RscMansfield. Both are included among the platform’s predefined indicators.

    #250203

    Hi Ivan,

     

    Thank you for your reply.

    Just because the Relative Strength (Comparison) and the RscMansfield are available, i thought it should be possible to see the codes that are used to access other assets in the codes ;

    these indicators do use other assets. So i do not understand why it is blocked.

    Bert

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

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