Getting a Day

 

Hello Folks,

I am new learning MQL4.

I am working on EA which should modify its values on Monday.

I used DayOfWeek function in comment section to check, during backtesting whether it's changing its value from 0 to 6.

but during back test it always shows 1 I dont know why.

Can anybody help in this

   Comment ("OrdersTotal ",OrdersTotal(),"\n",
   "lastorder ", a,"\n","Day ", DayOfWeek());
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Symbol Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
  1. A single line of code is useless; post all relevant code.
  2. Forex is closed on Saturday (ET). With most broker's timezones, you will not see 6.
  3. Forex opens on Sunday (ET). Depending on your broker's timezone, you might see a 1-2 hour Sunday (0) or not.