No trade on Monday 0:00-4:00

 

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.

 
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);
 
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!

Reason: