Recalculer la fonction RSI

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #67486 quote
    Alex92
    Participant
    New

    Bonjour,

    Je souhaite coder un robot multi time frame, c’est impossible sous PRT donc, j’essaye de ruser en re calculant moi même certains indicateurs comme le RSI.

    Après plusieurs tentatives, je n’arrive toujours pas à recalculer le RSI comme affiché par PRT.

    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"

    J’ai donc recalculer ma moyenne mobile de Wilder mais j’ai toujours 1 bougie de retard, je comprends pas pourquoi ?!

    Ensuite lorsque je fais le ratio upMA/downMA, impossible de sortir une donnée.. la commande “graph RS” ne retourne strictement rien (alors que upMA et downMA sont correctement alimentés).

    Voici mon code, si quelqu’un a un avis sur mes 2 problèmes ?

    periode = 14
    K = 1/periode
    
    UP = MAX(0, close - close[1])
    DOWN = MAX(0, close[1] - close)
    
    
    upMA = (UP - upMa)*K+upMA
    downMA = (DOWN - downMa)*K+downMA
    
    RS = upMA/downMA
    
    
    graph RS

     

    Merci pour votre aide et bon week end à tous !!

    Alexandre

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Recalculer la fonction RSI


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Alex92 @alex92 Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 04/07/2018
Status: Active
Attachments: No files
Logo Logo
Loading...