STRATEGIA CON HULL E CHATGPT

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #237986 quote
    GaspareGaspare
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
2 years ago.

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