Files
Bell-PriceActionWithEma-EA/Experts/EA_ICT_CL/Sessions.mqh
T
2026-03-10 20:39:33 +07:00

21 lines
568 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef EA_ICT_CL__SESSIONS_MQH
#define EA_ICT_CL__SESSIONS_MQH
/** True if hour (023) falls in [startHour, endHour); supports overnight range. */
inline bool IsHourInRange(const int hour, const int startHour, const int endHour)
{
if (startHour == endHour) return true;
if (startHour < endHour) return (hour >= startHour && hour < endHour);
return (hour >= startHour || hour < endHour);
}
/** Returns hour (023) in UTC for given datetime. */
inline int GetUTCHour(const datetime t)
{
MqlDateTime dt;
TimeToStruct(t, dt);
return dt.hour;
}
#endif