No trade on Monday 0:00-4:00

To add comments, please log in or register
chnp
149
chnp  

Hi,

Please help. 

I wrote this :

DayOfWeek()!=0 && hour()>3

This code cause no trades on Monday whole day and no trades 00:00-04:00 every day.

Please help, thanks.

Koros Jafarzadeh
870
Koros Jafarzadeh  
chnp:

Hi,

Please help. 

I wrote this :

This code cause no trades on Monday whole day and no trades 00:00-04:00 every day.

Please help, thanks.

put this code before OrderSend()

if(DayOfWeek()==1 && Hour()<4)
   return;


DayOfWeek

Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time.

int  DayOfWeek();

Returned value

Current zero-based day of the week (0-Sunday,1,2,3,4,5,6).

Note

At the testing, the last known server time is modelled.

Example:

  // do not work on holidays.

  if(DayOfWeek()==0 || DayOfWeek()==6) return(0);
chnp
149
chnp  
Koros Jafarzadeh:

put this code before OrderSend()


DayOfWeek

Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time.

Returned value

Current zero-based day of the week (0-Sunday,1,2,3,4,5,6).

Note

At the testing, the last known server time is modelled.

Example:

Thank you!

To add comments, please log in or register