using DayOfWeek() to against a previous date

 

Hello

I am trying to program a function that returns the DayOfWeek() at the begining of the trading month, so if the trading month began on a monday then it will return 1.

Can DayOfWeek() be used for historical dates?

For example:

DayOfWeek(iTime(Symbol(),PERIOD_MN1,0));

Thank you in advance

Antony

 
tonyjms2005:

Hello

I am trying to program a function that returns the DayOfWeek() at the begining of the trading month, so if the trading month began on a monday then it will return 1.

Can DayOfWeek() be used for historical dates?

For example:

Thank you in advance

Antony

Please read the documentation, DayOfWeek() doesn't take any parameters. Perhaps you mean TimeDayOfWeek() ?
Reason: