ottimizzazione only long giorni settimana

Viewing 8 posts - 31 through 38 (of 38 total)
  • Author
    Posts
  • #253611 quote
    phoentzsphoentzs
    Participant
    Master

    Perché non usi semplicemente il codice in TF H4 o H1?

    Gabriele Battista thanked this post
    #253635 quote
    Gabriele BattistaGabriele Battista
    Participant
    Senior

    Perchè non funziona ugualmente

    #253694 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Ciao! Vedo due problemi nel codice: 1) Lunedì è impostato su dayofweek=2, quindi se DOE=1, non vengono aperte posizioni. 2) La condizione di uscita day>day[1] non è vera alla fine del mese. Lo screenshot mostra entrambi i problemi che ho menzionato. Come altri hanno detto, bisogna tenere conto delle festività. Modificando la condizione di uscita, quindi, sembra che il problema si risolva.

    Questo codice è per il diario

    DEFPARAM CumulateOrders=False
    // DOE optimization (2-6 step=1)
    IF NOT ONMARKET and DayOfWeek=DOE then
       BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Si vende il gg successivo
    
    IF LONGONMARKET and dayofweek<>dayofweek[1] then//(DayOfWeek >=DOE+1) and (Day>Day[1]) then
       SELL 1 CONTRACT AT MARKET
    ENDIF
    
    //graph day
    graph DayOfWeek
    
    robertogozzi thanked this post
    2025-11-17_12-40.jpg 2025-11-17_12-40.jpg 2025-11-17_12-48.png 2025-11-17_12-48.png
    #253703 quote
    Gabriele BattistaGabriele Battista
    Participant
    Senior

    grazie prima di tutto, non ho capito che significa “Lunedì è impostato su dayofweek=2”: è la piattaforma che lo codifica così?

    #253704 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Ciò che intendo dire è che il backtest, nel timeframe giornaliero, assegna dayofweek=2 a lunedì. Pertanto, la variabile DOE deve cambiare da 2 a 6. Tuttavia, nel timeframe inferiore, lunedì ha il valore dayofweek=1.

    Gabriele Battista thanked this post
    #253706 quote
    Gabriele BattistaGabriele Battista
    Participant
    Senior

    il <> risolve anche il caso del giorno, o dei giorni, di chiusura di borsa successivo all’apertura di posizione. grazie. a volta le cose più semplici ci sfuggono.

    Iván González thanked this post
    #253708 quote
    JSJS
    Participant
    Master

    Avviso per gli utenti dell’istruzione DayOfWeek

    Sono state rilevate alcune incoerenze nel comportamento di DayOfWeek all’interno di ProRealTime:

    • ProBackTest – Timeframe giornaliero (1 giorno):
      DayOfWeek restituisce lunedì = 2. Tutti i giorni risultano quindi spostati di una posizione.

    • ProBackTest – Timeframe intraday:
      DayOfWeek restituisce lunedì = 1, come previsto.

    • Indicatori – Qualsiasi timeframe:
      DayOfWeek restituisce anch’esso lunedì = 1, quindi coerente con l’intraday in ProBackTest.

    Inoltre, al cambio del mese possono comparire valori errati, con il rischio di ottenere segnali o risultati non corretti.

    Queste anomalie sono importanti per chi utilizza logiche basate sui giorni della settimana nei backtest o negli indicatori.

    #253722 quote
    phoentzsphoentzs
    Participant
    Master
    Forse bisognerebbe aggiungere che il giorno feriale ora si estende al giorno feriale successivo alle 6:00. Quindi i sistemi intraday progettati per riconoscere il lunedì possono attivarsi anche il martedì mattina all’1:00. Grazie a PRT.
    Iván González thanked this post
Viewing 8 posts - 31 through 38 (of 38 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

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 phoentzsphoentzs
10 months ago.

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