Download MetaTrader 5

Day of Week in MQL5

To add comments, please log in or register
Wolfgang
83
Wolfgang 2010.01.06 15:46 

For a pivot indicator I need an expression to find Monday.

In MQL4 code

if (DayOfWeek() == 1) ...                

 

How do you code an expression to find the first day of the week in MQL5? 

Can you give an example? 

Rashid Umarov
Admin
11988
Rashid Umarov 2010.01.06 16:06  
Wolfgang
83
Wolfgang 2010.01.06 19:34  
Rosh   :
See MqlDateTime.


I looked at this link allready, but as a non -professional, only stupid trader, I need an example, which is closer to my needs.

An expression just for one day in the week.

Paul
784
Paul 2010.01.07 04:07  
walb99   :


I looked at this link allready, but as a non -professional, only stupid trader, I need an example, which is closer to my needs.

An expression just for one day in the week.


MQL5=>MQL4 conversion functions are here https://www.mql5.com/en/forum/121011/page18

In mt4datetime.mqh:

int DayOfWeek()
{
   MqlDateTime tm;
   TimeCurrent(tm);
   return(tm.day_of_week);
}

 Paul

http://paulsfxrandomwalk.blogspot.com/ 

Beta Testing of MetaTrader 5 Has Started! - MQL4 forum
  • www.mql5.com
Beta Testing of MetaTrader 5 Has Started! - MQL4 forum
Wolfgang
83
Wolfgang 2010.01.07 08:20  
phampton   :


MQL5=>MQL4 conversion functions are here https://www.mql5.com/en/forum/121011/page18

In mt4datetime.mqh:

 Paul

http://paulsfxrandomwalk.blogspot.com/ 


When I understand corrctly this means: I can use the old expression, with 

#include <mt4datetime.mqh>

 Compiler  shows no errors.

Hope it works

 

Thanks. 

To add comments, please log in or register