ea-health-monitor/mql4/Indicators/EAHealth/EAClock.mqh
Allan Niñal Allan Niñal 286e60f707 Free source regenerated: Pro-only code removed from the engine, debug log added
Generated by the publish tool from the private source; all publish gates pass, compile 0 errors 0 warnings on MT5 and MT4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 08:12:10 +08:00
27 lines
1.1 KiB
MQL5
//+------------------------------------------------------------------+
//| EAClock.mqh |
//| Copyright 2026, Allan Niñal |
//| https://www.allanninal.dev/mql5 |
//+------------------------------------------------------------------+
//| The millisecond clock of the panel: wall clock live, simulated |
//| server time in the tester. |
//+------------------------------------------------------------------+
// SPDX-License-Identifier: LicenseRef-PolyForm-Noncommercial-1.0.0 (see LICENSE)
#ifndef EACLOCK_MQH
#define EACLOCK_MQH
//--- "now" in ms: wall clock live, simulated server time in the tester (which runs far faster than real time)
ulong SDNowMs()
{
if(IsTesting())
return((ulong)TimeCurrent()*1000);
static ulong hi=0; // MQL4 has only the 32-bit GetTickCount: count its wraps (every 49.7 days)
static uint last=0;
uint now=GetTickCount();
if(now<last)
hi+=((ulong)1<<32);
last=now;
return(hi+now);
}
#endif