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
if time >= 050000 and time <= 220000 then
//your conditions
endif
come questo
if (OpenDayOfWeek=1 and opentime>=050000) and (OpenDayOfWeek=5 and time<220000)then
endif
come questo
|
|
if (OpenDayOfWeek=1 and opentime>=050000) and (OpenDayOfWeek=5 and time<220000)then
endif
|
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
if (OpenDayOfWeek>=1 and opentime>=050000) and (OpenDayOfWeek<=5 and time<220000)then
endif
|
|
if (OpenDayOfWeek>=1 and opentime>=050000) and (OpenDayOfWeek<=5 and time<220000)then
endif
|
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 ??
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.
prova questo
if (openDayOfWeek=1 and opentime>=050000) then
signal=1
endif
if (openDayOfWeek=5 and opentime>=220000) then
signal=0
endif
return signal
prova questo
|
|
if (openDayOfWeek=1 and opentime>=050000) then
signal=1
endif
if (openDayOfWeek=5 and opentime>=220000) then
signal=0
endif
return signal
|
dunque….può funzionare se OpenDayOfWeek>=1, altrimenti funziona solo il lunedi.
Il resto dovrebbe andare.
Grazie
funziona dal lunedì alle 5.00 al venerdì alle 22.00
come mostrato nella schermata qui sopra
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
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