Download MetaTrader 5

using DayOfWeek() to against a previous date

To add comments, please log in or register
antony
549
antony  

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
18017
Simon Gniadkowski  
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