ottimizzazione only long giorni settimana

Viewing 15 posts - 1 through 15 (of 38 total)
  • Author
    Posts
  • #253416 quote
    Gabriele Battista
    Participant
    Senior

    Non capisco perchè non funziona come mi aspetto il codice con ottimizzazione.

    #253417 quote
    robertogozzi
    Moderator
    Master

    L’unico che può darti una risposta sei tu stesso, a meno che non posti il codice completo e funzionante (sia testo che il file ITF, se possibile)  dicendo che ottimizzazioni vuoi fare e dove, secondo te, non funzionano.

    Gabriele Battista thanked this post
    #253419 quote
    Gabriele Battista
    Participant
    Senior

    hai perfettamente ragione, non riuscivo ad allegare un file ne ad inserire il codice

    DEFPARAM CumulateOrders=False

    //OTTIMIZZAZIONE:
    //DOE da 1 a 5
    //Step 1

    // Si compra il giorno
    // 1=lunedì 2=martedì 3=mercoledì 4=giovedì

    IF NOT ONMARKET and DayOfWeek=DOE then
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Si vende il gg successivo

    IF LONGONMARKET and (DayOfWeek >=DOE+1) and (Day>Day[1]) then
    SELL 1 CONTRACT AT MARKET
    ENDIF

     

     

     

    #253421 quote
    JS
    Participant
    Senior

    Ciao,

    Quando ottimizzi il codice con la variabile DOE, ottieni (solo) quattro risultati:

    uno per quando hai comprato di lunedì e gli altri per quando hai comprato di martedì, mercoledì o giovedì…

    Ora puoi vedere qual è il giorno ottimale, nel periodo considerato, per comprare…

    Gabriele Battista and Iván González thanked this post
    #253428 quote
    Gabriele Battista
    Participant
    Senior

    e per avere il 5° risultato, comprando il venerdì come si può fare?

    #253429 quote
    JS
    Participant
    Senior

    Per includere anche il venerdì nei risultati, puoi ottimizzare “DOE” da 1 a 5 (invece di da 1 a 4)…

    #253433 quote
    Gabriele Battista
    Participant
    Senior

    se guardi il mio codice ottimizza già come scrivi tu. l’errore è un altro

    #253434 quote
    JS
    Participant
    Senior

    Qual è il “non vato”, cosa non va bene…?

    #253436 quote
    Gabriele Battista
    Participant
    Senior

    Nel tuo screen, che non avevo visto, l’ottimizzazione per il valore 5 è vuoto.

    #253438 quote
    JS
    Participant
    Senior

    Il fatto che la posizione aperta il venerdì non venga venduta non dipende dall’ottimizzazione, ma dal codice…

    Nel codice è indicato che una posizione aperta il venerdì deve essere chiusa il giorno successivo, ma il giorno successivo è sabato (mercato chiuso), quindi la posizione non può essere chiusa…

    Puoi modificare facilmente il codice in questo modo:

    DEFPARAM CumulateOrders=False
    
    //OPTIMIZATION:
    //DOE 1 to 5
    //Step 1
    
    // You buy on the day
    // 1=Monday 2=Tuesday 3=Wednesday 4=Thursday
    
    IF NOT ONMARKET and DayOfWeek=DOE then
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // It will be sold the following day
    If LongOnMarket and DOE=5 and DayOfWeek=1 then
    Sell 1 contract at Market
    ElsIf LONGONMARKET and (DayOfWeek >=DOE+1) and (Day>Day[1]) then
    SELL 1 CONTRACT AT MARKET
    ENDIF
    
    robertogozzi and Gabriele Battista thanked this post
    #253449 quote
    Gabriele Battista
    Participant
    Senior

    Su che TIME FRAME lo fai girare? A me su TF giornaliero continua a dare 0 il lunedì.

    #253458 quote
    JS
    Participant
    Senior

    Puoi utilizzare qualsiasi timeframe “intraday”…

    Gabriele Battista thanked this post
    #253464 quote
    Gabriele Battista
    Participant
    Senior

    OK ma vorrei capire qual è il motivo che non lo fa funzionare sul daily. Ho uno storico ridotto se scendo in intraday senza versione premium.

    #253467 quote
    Gabriele Battista
    Participant
    Senior

    tra l’altro c’è qualcosa che non funziona neanche in intraday se guardo il numero di trade che dovrebbe essere più o meno simile nei gg della settimana

    #253476 quote
    JS
    Participant
    Senior

    Ottengo questo risultato per il DAX…

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

ottimizzazione only long giorni settimana


ProOrder: Trading Automatico & Backtesting

New Reply
Summary

This topic contains 37 replies,
has 5 voices, and was last updated by phoentzs
2 months, 3 weeks ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/08/2025
Status: Active
Attachments: 20 files
Logo Logo
Loading...