DAX LONG 2H (17.00-22.00)

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #241325 quote
    10081970
    Participant
    New

    Ciao,

    ho bisogno del vs. aiuto per caire cpome integrare il tool in modo che chiuda la posizioneaalle 22.00 ed evitare oneri di overnight.

    Ho provato a cambiare l’rario di fine trading ma utilizzando time frame 2H mi chiude comunque alle 23.00

     

    Grazie anticipatamente

    #241374 quote
    robertogozzi
    Moderator
    Master

    Occorre che una barra apra/chiuda alle 220000.

    Se vuoi usare il 2 ore,  aggiungi un timeframe a 1 ora per potere uscire alle 220000,.

    #241377 quote
    10081970
    Participant
    New

    Grazie, purtroppo con TF a 1H il risultato non è accettabile

    #241411 quote
    robertogozzi
    Moderator
    Master

    Però con i due timeframe insieme puoi sempre valutare le condizioni sul 2 ore ed usare 1 ora solo per uscire alle 22.

    #241414 quote
    10081970
    Participant
    New

    Non lo sapevo ma non so neanche come aggiungere questa funzione al tool. Mi potresti indicare cosa scrivere?
    grazie

    #241457 quote
    Iván González
    Moderator
    Master

    Ciao!
    Come dice Roberto devi lavorare con 2 TF. Quello di 2 ore per i calcoli e l’altro per permetterti di partire il più tardi possibile senza andare oltre le 22:00. Ad esempio, se utilizzi un TF di 5 mn allora puoi impostare l’istruzione flat dopo le 215500. In questo modo uscirete all’apertura dell’ultima barra a 5 minuti della giornata.

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    // Il sistema cancellerà tutti gli ordini in attesa e chiuderà tutte le posizioni a 0:00. Dopo l'orario "Flat Before" non saranno piazzati nuovi ordini o posizioni.
    DEFPARAM FLATBEFORE = 170000
    // Cancellare tutti gli ordini in attesa e chiudere tutte le posizioni all'orario "Flat After"
    DEFPARAM FLATAFTER = 215500
    timeframe(2h,updateonclose)
    // Impedisce al sistema di tradare in giorni specifici della settimana
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    // Condition to limit only one trade per day
    firstbar = barindex - intradaybarindex
    if tradeindex(1) <  firstbar then
    nottraded = 1
    elsif tradeindex(1) >= firstbar then
    traded = 0
    endif
    // Condizioni per entrare su posizioni long
    c1 = (close[1] > DClose(1)[1])
    IF c1 AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    // Stop e target
    SET STOP pLOSS 200
    SET TARGET pPROFIT 180
    timeframe(5mn)
    robertogozzi thanked this post
    #241527 quote
    10081970
    Participant
    New

    Grazie

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

DAX LONG 2H (17.00-22.00)


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
10081970 @10081970 Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by 10081970
1 year, 1 month ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 12/11/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...