Download MetaTrader 5

using DayOfWeek() to against a previous date

To add comments, please log in or register
One billion tasks have already been executed with MQL5 Cloud Network. Test trading robots even faster!
antony
549
antony 2014.01.29 14:46 

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

Simon Gniadkowski
Moderator
17999
Simon Gniadkowski 2014.01.29 15:07  
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() ?
To add comments, please log in or register