Structuring code into files

This commit is contained in:
Bell
2026-03-10 13:47:42 +07:00
parent 3591694c96
commit 1ddb802480
22 changed files with 1766 additions and 1416 deletions
+33
View File
@@ -0,0 +1,33 @@
#ifndef EA_ICT_CL__UTILS_MQH
#define EA_ICT_CL__UTILS_MQH
// Module: Utils
// Put small, dependency-free helpers here (time, rounding, clamps, formatting).
inline double ClampDouble(const double v, const double lo, const double hi)
{
if (v < lo) return lo;
if (v > hi) return hi;
return v;
}
inline int ClampInt(const int v, const int lo, const int hi)
{
if (v < lo) return lo;
if (v > hi) return hi;
return v;
}
inline double RoundToStep(const double value, const double step)
{
if (step <= 0.0) return value;
return MathRound(value / step) * step;
}
inline bool IsNewBar(const datetime last_bar_time, const datetime current_bar_time)
{
return (current_bar_time != 0 && current_bar_time != last_bar_time);
}
#endif // EA_ICT_CL__UTILS_MQH