Time management functions are often used in Expert Advisors and Scripts. This header file contains functions and input variables for checking time and day of week.
Function | Description |
---|---|
bool CheckTime() | The function checks current time and returns true when trade is allowed, false – trade is not allowed. It uses input variables:
|
bool CheckDayOfWeek() | The function checks week day returns true when trade is allowed, false – trade is not allowed. It uses input variables:
|
Example
#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; Â Â } }