Non Operare in alcune settimane dell’ anno

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #232175 quote
    Paolo.B
    Participant
    Average

    Ciao Roberto, ho trovato questo che hai fatto tu.

    Avrei gentilmente bisogno di una cosa diversa se possibile.

    Vorrei disabilitare alcune settimane dell’anno, per esempio:

    La prima e la quarta settimana di agosto.

    In quello da te fatto purtroppo posso disabilitare tutto il mese di Agosto, e i giorni non mi servono.

    Ti ringrazio in anticipo

    Paolo

    ONCE startT = 000000
    ONCE endT   = 240000
    TimeRef     = OpenTime
    DayRef      = OpenDayOfWeek
    MonthRef    = OpenMonth
    td0         = 1 AND DayRef = 0 AND TimeRef >= startT AND TimeRef <= endT      //Sunday
    td1         = 1 AND DayRef = 1 AND TimeRef >= startT AND TimeRef <= endT      //Monday
    td2         = 1 AND DayRef = 2 AND TimeRef >= startT AND TimeRef <= endT      //Tuesday
    td3         = 0 AND DayRef = 3 AND TimeRef >= startT AND TimeRef <= endT      //Wednesday
    td4         = 1 AND DayRef = 4 AND TimeRef >= startT AND TimeRef <= endT      //Thursday
    td5         = 1 AND DayRef = 5 AND TimeRef >= startT AND TimeRef <= endT      //Friday
    td6         = 0 AND DayRef = 6 AND TimeRef >= startT AND TimeRef <= endT      //Saturday
    tdCond      = td0 OR td1 OR td2 OR td3 OR td4 OR td5 OR td6
    m1          = 1 AND MonthRef = 1                                              //January
    m2          = 1 AND MonthRef = 2                                              //February
    m3          = 1 AND MonthRef = 3                                              //March
    m4          = 1 AND MonthRef = 4                                              //April
    m5          = 1 AND MonthRef = 5                                              //May
    m6          = 1 AND MonthRef = 6                                              //June
    m7          = 1 AND MonthRef = 7                                              //July
    m8          = 1 AND MonthRef = 8                                              //August
    m9          = 1 AND MonthRef = 9                                              //September
    m10         = 1 AND MonthRef = 10                                             //October
    m11         = 1 AND MonthRef = 11                                             //November
    m12         = 1 AND MonthRef = 12                                             //December
    mCond       = m1 OR m2 OR m3 OR m4 OR m5 OR m6 OR m7 OR m8 OR m9 OR m10 OR m11 OR m12
    tdmCond     = tdCond AND mCond
    #232208 quote
    robertogozzi
    Moderator
    Master

    Le settimane non sono identificate.

    Occorre fare dei calcoli un pò lunghi per ottenere il risultato, ci vorrà un pò di tempo.

    In alternativa, ad inizio anno, tu saprai quali sono le date da disabilitare, ad esempio dal 06/05/2024 al 10/05/2024 e dal 05/08/2024 al 09/08/2024, ecc… Quindi si potrebbe organizzare in modo che le date le inserisci tu ad inizio anno e sarebbe molto più semplice.

    Fammi sapere.

    #232209 quote
    Paolo.B
    Participant
    Average

    Ciao Roberto, ti ringrazio per la tua risposta.

    In realtà sarebbe ottimale poter suddividere il mese in due, ad esempio dal 1 al 15 Agosto, e da 16 al 30 Agosto.

    Questo è quello che mi interesserebbe, invece di bloccare tutto il mese avrei la possibilità di bloccare 15 giorni.

    Ho fatto un esempio per Agosto, ma anche altri mesi per esempio Dicembre.

    Se fosse possibile te ne sarei grato.

    Grazie

    #232213 quote
    MaoRai54
    Participant
    Master

    dovrebbe essere cosi’:

    if date=>20240801 and date<=20240807 or  date=>20240821 and date<=20240831 then

    NoTrade=1

    else

    NoTrade=0

    endif

    // qui le tue condizioni

    if tue condizioni and NoTrade=0 then

    ………

    // non opera nella 1 e ultima settimana di agosto

    robertogozzi thanked this post
    #232240 quote
    Paolo.B
    Participant
    Average

    Ottimo, funziona decisamente bene.

    Grazie

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

Non Operare in alcune settimane dell’ anno


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Paolo.B @paolo-b Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Paolo.B
1 year, 9 months ago.

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