Vérification RSI Prorealtime

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #163022 quote
    Yodavin
    Participant
    Junior

    Bonjour,

    Je cherche à développer un indicateur perso à partir du RSI, j’ai d’abord voulu vérifier que je code bien le RSI de Prorealtime et.. raté.

    Le résultat est différent du RSI de Prorealtime. J’ai lu sur le forum qu’il y a différent façon de calculer le RSI et que Prorealtime utilise la méthode de Walder:

    The very first calculations for average gain and average loss are simple 14-period averages:

    • First Average Gain = Sum of Gains over the past 14 periods / 14.
    • First Average Loss = Sum of Losses over the past 14 periods / 14

    The second, and subsequent, calculations are based on the prior averages and the current gain loss:

    • Average Gain = [(previous Average Gain) x 13 + current Gain] / 14.
    • Average Loss = [(previous Average Loss) x 13 + current Loss] / 14.
    If close-close[1]>0 then
    Ha=close-close[1]
    B=0
    elsif close-close[1]<0 then
    B=-close+close[1]
    Ha=0
    else
    Ha=0
    B=0
    endif
    
    aH=average[L](Ha)
    aB=average[L](B)
    RS=(aH[1]*(L-1)+Ha)/(aB[1]*(L-1)+B)
    RSIperso=100-100/(1+RS)
    
    return RSI[L](close),RSIperso

    Si quelqu’un a une idée je suis preneur.

    Merci et bonne journée

    Capture-decran-2021-03-03-104639.png Capture-decran-2021-03-03-104639.png
    #163027 quote
    Nicolas
    Keymaster
    Master

    Tu trouveras ci-dessous le code du RSI de ProRealTime:

    p=14
    REM Computes the daily variations
    
    UP = MAX(0, close - close[1])
    DOWN = MAX(0, close[1] - close)
    
    REM Computes the moving average of gains on positive days
    REM and losses on negative days
    
    upMA = wilderAverage[p](UP)
    downMA = wilderAverage[p](DOWN)
    
    REM Now we can compute the RS
    
    RS = upMA / downMA
    
    REM And finally the RSI
    
    myRSI = 100 - 100 / (1 + RS)
    
    RETURN myRSI AS "Relative Strength Index"
    #163074 quote
    Yodavin
    Participant
    Junior

    Merci beaucoup Nicolas, j’ai pu faire ce que je voulais

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Vérification RSI Prorealtime


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Yodavin @yodavin Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Yodavin
4 years, 12 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 03/03/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...