Garch model indicatore

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #235654 quote
    luxrun
    Participant
    Master

    Buongiorno, nel pdf Ifta edizione 2020, nell’articolo di Gioele Giordano “Antifragile Asset Allocation Model”, per calcolare la volatilità, ovvero il rischio dell’asset, viene usato il modello Garch, editato dall’autore, senza altra spiegazione. Qualcuno conosce se questo modello (funzione) è replicabile in Prorealcode o se è già stato fatto? Ho trovato poco su internet e solo un post su Prorealcode, ma non utile, alla mia curiosità. Grazie

    #235671 quote
    Iván González
    Moderator
    Master

    Ciao, Sconosciuto è un modo per calcolare la volatilità. Con l'aiuto di chatGPT ha creato questo indicatore:

    // Parameters for GARCH(1,1)
    alpha0 = 0.000001
    alpha1 = 0.1
    beta1 = 0.85
    
    lastbars=200
    // Initialize arrays
    $volatility[0] = alpha0 / (1 - alpha1 - beta1) // Initial volatility
    $squaredResiduals[0] = 0
    
    if barindex > lastbars then
    // Loop to calculate squared residuals and GARCH volatility
    FOR i = 1 TO lastbars DO
    $squaredResiduals[i] = pow((close[i] - close[i-1]),2)
    IF i > 1 THEN
    $volatility[i] = alpha0 + alpha1 * $squaredResiduals[i-1] + beta1 * $volatility[i-1]
    ENDIF
    NEXT
    // Convert variance to standard deviation (volatility)
    $volatility[lastset($volatility)] = sqrt($volatility[lastset($volatility)])
    endif
    
    // Plot the volatility
    RETURN $volatility[lastset($volatility)] AS "GARCH Volatility"
    robertogozzi and luxrun thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Garch model indicatore


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
luxrun @luxrun Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván González
1 year, 6 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 07/23/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...