STRATEGIA CON HULL E CHATGPT

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #237986 quote
    Gaspare
    Participant
    Veteran
    // Setting the parameters for the Hull Moving Averages
    ShortTermLength = 9
    LongTermLength = 21
     
    TakeProfitX = 50 // adjust this to your liking
    StopLossY = 25 // adjust this to your liking
     
    // Calculate the Hull Moving Averages
    ShortTermHMA = HullAverage[ShortTermLength](close)
    LongTermHMA = HullAverage[LongTermLength](close)
     
    // Identify when the ShortTermHMA changes from decreasing (red) to increasing (green) and LongTermHMA is also increasing
    if (ShortTermHMA[1] < ShortTermHMA[2] and ShortTermHMA > ShortTermHMA[1]) and LongTermHMA > LongTermHMA[1] then
        buy at market
        set target pprofit TakeProfitX
        set stop ploss StopLossY
    endif

    Ciao Roberto, Ciao Nicolas

    questa strategia di Nicolas con la media di Hull prevede solo la versione long

    si puo’ aggiungere, per favore, anche la versione short?

    Grazie

    #237991 quote
    robertogozzi
    Moderator
    Master

    Aggiungi queste righe alla fine del tuo codice:

    if (ShortTermHMA[1] > ShortTermHMA[2] and ShortTermHMA < ShortTermHMA[1]) and LongTermHMA < LongTermHMA[1] then
        sellshort at market
        set target pprofit TakeProfitX
        set stop ploss StopLossY
    endif
    Gaspare and Iván González thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

STRATEGIA CON HULL E CHATGPT


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Gaspare @gaspare Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
1 year, 4 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/25/2024
Status: Active
Attachments: No files
Logo Logo
Loading...