Trading time – Intervallo di trading

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #222157 quote
    Alessandro FurlaniAlessandro Furlani
    Participant
    Senior

    Salve a tutti, vorrei che i miei ProOrder fossero attivi solo dal Lunedi alle 5:00 (ora locale CET) fino al Venerdi alle 22:00, ma non voglio che vengano chiusi gli ordini attivi. Mi basta che gli script non facciano niente.

    Ho cercato nei manuali ma non trovo un modo per farlo, l’unico sembra essere l’uso del FlatAfter/Before che però chiude gli ordini.

    A me piacerebbe una sorta di routine che dica allo script puoi andare a mercato oppure no.

    C’è qualche metodo che mi sono perso ?

     

    saluti

    #222160 quote
    phoentzsphoentzs
    Participant
    Master
    if time >= 050000 and time <= 220000 then
    
    //your conditions 
    
    endif
    #222163 quote
    Alessandro FurlaniAlessandro Furlani
    Participant
    Senior


    Eh no, questo funziona tutti i giorni.  C’è una istruzione che aggiunge il test del giorno ?

    #222164 quote
    fifi743fifi743
    Participant
    Master

    come questo

    if (OpenDayOfWeek=1 and opentime>=050000) and (OpenDayOfWeek=5 and time<220000)then
    endif
    #222165 quote
    Alessandro FurlaniAlessandro Furlani
    Participant
    Senior

    come questo

    Questo non funzerà mai, caso mai sarebbe cosi:

    if (OpenDayOfWeek=1 and OpenDayOfWeek<6) and (time>=050000 and time<223100)then
    endif
    Se però lo faccio in questo altro modo che differenza c’è ?
    if (CurrentDayOfWeek=1 and CurrentDayOfWeek<6) and (CurrentTime>=050000 and CurrentTime<223100) then

    actions…………
    endif

    #222166 quote
    fifi743fifi743
    Participant
    Master
    
    if (OpenDayOfWeek>=1 and opentime>=050000) and (OpenDayOfWeek<=5 and time<220000)then
    
    endif
    
    
    #222175 quote
    Alessandro FurlaniAlessandro Furlani
    Participant
    Senior

    Non va bene, questo apre tutti i giorni alle 5:00 e chiude tutti i giorni alle 22:00. Io voglio un controllo che lavori a mercato dalle 5:00 di lunedi fino alle 22:30 di Venerdi.

    Mi sa che serve un doppio or,tipo questo:

    if (CurrentDayofWeek=1 and time>050000) or (CurrentDayOfWeek>1 and CurrentDayOfWeek<4) or (CurrentDayOfWeek=5 and time<223000) then…………….

    così funza……….credo

     

    Qualcuno mi dice la differenza tra OpenDayOfWeek e CurrentDayOfWeek ??

    #222190 quote
    NicolasNicolas
    Keymaster
    Legend

    con un semplice codice puoi vedere le differenze:

    return opendayofweek,currentdayofweek

    currentdayofweek restituisce il giorno della settimana in tempo reale, mentre opendayofweek restituisce il numero del giorno nella cronologia. Esempio: oggi è lunedì, quindi currentdayofweek restituisce 1 sulla barra corrente ma anche nel grafico cronologico.

    #222200 quote
    fifi743fifi743
    Participant
    Master

    prova questo

    if (openDayOfWeek=1 and opentime>=050000) then
    
    signal=1
    endif
    if (openDayOfWeek=5 and opentime>=220000) then
    
    signal=0
    endif
    return signal
    Capture-decran-2023-10-09-153615.png Capture-decran-2023-10-09-153615.png
    #222202 quote
    Alessandro FurlaniAlessandro Furlani
    Participant
    Senior

    prova questo

    dunque….può funzionare se OpenDayOfWeek>=1, altrimenti funziona solo il lunedi.

    Il resto dovrebbe andare.

    Grazie

    #222203 quote
    fifi743fifi743
    Participant
    Master

    funziona dal lunedì alle 5.00 al venerdì alle 22.00
    come mostrato nella schermata qui sopra

    #222205 quote
    Alessandro FurlaniAlessandro Furlani
    Participant
    Senior

    funziona dal lunedì alle 5.00 al venerdì alle 22.00

    come mostrato nella schermata qui sopra

    solo se metti, OpenDayOfWeek>=1, altrimenti pretende di che sia sempre Lunedi per poter andare

    #222206 quote
    Alessandro FurlaniAlessandro Furlani
    Participant
    Senior

    Ecco it test completo di tutte le combinazioni. Dove ovviamente GoNoGo=1 vuol dire OK vai a mercato

     

    if (CurrentDayOfWeek=1 and CurrentTime>050000) then
    GoNoGo=1
    elsif (CurrentDayOfWeek>1 and CurrentDayOfWeek<5) then
    GoNoGo=1
    elsif (CurrentDayOfWeek=5 and CurrentTime>223000) then
    GoNoGo=0
    endif

Viewing 13 posts - 1 through 13 (of 13 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

Trading time – Intervallo di trading


ProOrder: Trading Automatico & Backtesting

New Reply
Summary

This topic contains 12 replies,
has 4 voices, and was last updated by Alessandro FurlaniAlessandro Furlani
2 years, 11 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 10/08/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...