TTI RSIV-1

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35570 quote
    Billy Ray ValentineBilly Ray Valentine
    Participant
    Senior

    Salve, quello che segue è il codice in formato MetaStock per esprimere una versione dell’RSI nella quale viene utilizzata la regressione lineare. In questo codice, ci sono due differenze principali rispetto al metodo originale dell’RSI: al rigo 6, la variazione del prezzo viene calcolata come variazione della distanza del prezzo di chiusura rispetto alla retta di regressione lineare. L’RSI originale, invece,  calcolava la variazione fra i prezzi di chiusura dei due periodi. La seconda differenza principale è che il TTI RSIV-1 calcola un semplice prodotto tra una media esponenziale delle variazioni al rialzo e una media esponenziale delle variazioni del prezzo al ribasso, ricorrendo a una moltiplicazione. Il processo di moltiplicazione dà maggiore risalto ai movimenti più ampi, amplificando in tal modo la volatilità. E’ a causa di questa variazione che le soglie di attivazione dovrebbero essere portate a 25 e 75.

    Ringrazio anticipatamente chiunque voglia aiutarmi a trasformarlo in linguaggio per PRT.

    1 (User inputs)
    2 pds1:= Input (“Lookback”, 2, 1000, 30) ;
    3 pds2:= Input (“Linear Regression Period”, 2, 1000, 40) ;
    4 (Defines the difference between the day’s closing price and the
    5 linear regression line, and assigns the value to the variable x1)
    6 x1:= (C – LinearReg (C, pds2, S, 1) ) ;
    7 (Conditional logic to define an Up day for x1)
    8 x2:= If (x1 > Ref (x1, – 1), 1, 0) ;
    9 (Conditional logic to measure an increase in x1 on an Up day)
    10 x3:= If (x1 >Ref (x1, – 1), x1 – Ref (x1, – 1), 0) ;
    11 (Conditional logic to define a Down day for x1)
    12 x4:= If (x1 < Ref (x1, – 1), 1, 0) ;
    13 (Conditional logic to measure a decrease in x1 on a Down day)
    14 x5:= If (x1 < Ref (x1, – 1), Ref (x1, – 1) – x1, 0) ;
    15 (Multiplies the sum of the increases on Up days by the number
    16 of Up days)
    17 x6:= Sum (x3, pds1) * Sum (x2, pds1) ;
    18 (Multiplies the sum of the decreases on Down days by the number
    19 of Down days)
    20 x7:= Sum (x5, pds1) * Sum (x4, pds1) ;
    21 (Calculates the ratio of trend adjusted increases to trend adjusted
    22 decreases, and then converts it to a value between 0 and 100)
    23 x8:= 100 – (100 / (1+ (x6 / x7))) ;
    24 (Plots the TTI RSIV-1)
    25 x8

    #35686 quote
    NicolasNicolas
    Keymaster
    Legend

    Non doppio post. Puoi anche imparare a codificare se pensate che le cose non siano più veloci che vuoi 🙂

    #35699 quote
    Billy Ray ValentineBilly Ray Valentine
    Participant
    Senior

    Ti chiedo scusa Nicolas 🙂 pensavo non l’avesse visto nessuno il post

    #35769 quote
    NicolasNicolas
    Keymaster
    Legend

    L’indicatore è stato convertito con successo in codice prorealtime, ora è possibile scaricarlo direttamente nella sezione libreria del sito web:

    TTI RSIV-1 indicator

    Billy Ray Valentine thanked this post
    #35776 quote
    Billy Ray ValentineBilly Ray Valentine
    Participant
    Senior

    Grazie Nicolas 🙂

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

TTI RSIV-1


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Billy Ray ValentineBilly Ray Valentine
9 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 05/15/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...