Files
Bell-PriceActionWithEma-EA/Experts/EA_ICT_CL/Sessions.mqh
T

21 lines
568 B
Plaintext
Raw Normal View History

2026-03-10 13:47:42 +07:00
#ifndef EA_ICT_CL__SESSIONS_MQH
2026-03-10 20:39:33 +07:00
#define EA_ICT_CL__SESSIONS_MQH
2026-03-10 13:47:42 +07:00
2026-03-10 20:39:33 +07:00
/** True if hour (023) falls in [startHour, endHour); supports overnight range. */
inline bool IsHourInRange(const int hour, const int startHour, const int endHour)
2026-03-10 13:47:42 +07:00
{
2026-03-10 20:39:33 +07:00
if (startHour == endHour) return true;
if (startHour < endHour) return (hour >= startHour && hour < endHour);
return (hour >= startHour || hour < endHour);
2026-03-10 13:47:42 +07:00
}
2026-03-10 20:39:33 +07:00
/** Returns hour (023) in UTC for given datetime. */
2026-03-10 13:47:42 +07:00
inline int GetUTCHour(const datetime t)
{
MqlDateTime dt;
2026-03-10 20:39:33 +07:00
TimeToStruct(t, dt);
return dt.hour;
2026-03-10 13:47:42 +07:00
}
2026-03-10 20:39:33 +07:00
#endif