Formula codice RSI

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #176020 quote
    MauroPro
    Participant
    Veteran

    Ciao Roberto, riusciresti a scrivere la formula dell’ Rsi a 14 periodi? (non la ho trovata nella libreria).

    Mi interessa la formula per poter provare delle modifiche, quindi non mi basta :

    lenghtRsi = 14

    rsi [lenghtRsi](close)

    Grazie

    #176023 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    // RSI custom
    //
    // (https://www.prorealcode.com/topic/indicatore-rsi/#post-51250)
    // (https://www.investopedia.com/terms/r/rsi.asp)
    //
    p  = 14
    Ob = 70
    Os = 100 - Ob
    //
    // Determina le variazione giornaliere
    rialzo  = MAX(0, CLOSE - CLOSE[1])
    ribasso = MAX(0, CLOSE[1] - CLOSE)
    
    // Calcola la media dei guadagni i giorni di rialzo
    // e delle perdite i gorni di ribasso
    mmRialzo  = WILDERAVERAGE[p](rialzo)
    mmRibasso = WILDERAVERAGE[p](ribasso)
    
    // Calcolo RS
    RS = mmRialzo / mmRibasso
    
    // E finalmente l’RSI
    mioRSI = 100 - (100 / (1 + RS))
    
    RETURN mioRSI AS "Rsi",Os AS "Os",Ob AS "Ob", 50 as "Mid"
    MauroPro thanked this post
    #176024 quote
    MauroPro
    Participant
    Veteran

    Perfetto grazie, l’ho provata ed è identica a quella inserita negli  indicatori di Prt.

    Un ultima cosa: la wilderAverage (linee 16 e 17) sarebbe la “media mobile lisciatura di Wilder”  e sarebbe anche il tipo 3? Grazie

    Image-002.jpg Image-002.jpg Image-001-1.jpg Image-001-1.jpg
    #176031 quote
    robertogozzi
    Moderator
    Master

    Si, esatto.

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

Formula codice RSI


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
MauroPro @mauropro Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzi
4 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 08/23/2021
Status: Active
Attachments: 2 files
Logo Logo
Loading...