Libraries: TimeManagement

Automated-Trading  

TimeManagement:

The header file contains functions and input variables for a time management.

#include <TimeManagement.mqh>

void OnTick()
{
   if( !CheckTime() )
   {
      Print("The trade is not allowed by time management");
      return;
   }

   if( !CheckDayOfWeek() )
   {
      Print("The trade is not allowed in this day of week");
      return;
   }
}

Author: Alexey Lopatin

Alain Verleyen  
Kiril Vasilev:
Hi, I am trying to use time management function for day of the week, but I receive error message can you help me? Where do I have to define DayOfWeek and how?

This library is designed for MT4, not MT5.
Alexey Lopatin  
fxsaber:

This code is designed for MT4.

For MT5 you can try this code:

MqlDateTime currentTime;
TimeCurrent(currentTime);
int day_week=currentTime.day_of_week;
Alain Verleyen  
Alexey Lopatin:

This code is designed for MT4.

For MT5 you can try this code:

Next enough. There will be problem with StringConcatenate() for example. I didn't check all.
Alexey Lopatin  
Kiril Vasilev:

Can you point me to more detailed solution  like the one in the library for MT4, with the whole code, includes and etc, I don`t have a lot of experience with mql5? :)

In the attached file code for MT5.

Files: