TimeInRange Time Check Function - Library for MetaTrader 4 - MT4/MT5 Resources
Quick time range checking function. Does not use slow string parsing.
If the time is within the range, the function returns TRUE, otherwise it returns FALSE.
Drag and drop the .mq4 file into the MQL4\Libraries\ folder.
Add this line to your EA:
#include "..\libraries\time_in_range.mq4"There are three versions of this function:
1. With separated hours and minutes input. Example:
if (timerange( timecurrent (), 23 , 00 , 02 , 15 )) { /* trade*/ } // Check if the current time is within the range of 23:00-02:15
2. Enter the decimal number. example:
Attachment download
📎 time_in_range.mq4 (3.22 KB)
Source: MQL5 #16398
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •