//+------------------------------------------------------------------+ //| HealthLive.mqh | //| Copyright 2026, Allan NiƱal | //| https://www.allanninal.dev/mql5 | //+------------------------------------------------------------------+ //| The live side of EA Health Monitor: reads only the deals added | //| since the last refresh (a new day or a shorter history starts | //| again), the open positions per magic, and the names: the user's | //| list "magic=name,...", else the comment of the EA's first | //| opening deal, "Manual" for magic 0. | //+------------------------------------------------------------------+ // SPDX-License-Identifier: LicenseRef-PolyForm-Noncommercial-1.0.0 (see LICENSE) #ifndef HEALTHLIVE_MQH #define HEALTHLIVE_MQH #include "HealthCore.mqh" struct EHLive { EHBook b; int done; // history deals processed ulong last_ticket; // ticket of deal done-1 (older deals synced in later move it: start again) long since,day; int pos_n; // positions and balance at the last history read: unchanged = no new deal to read double bal; ulong full_ms; long map_magic[]; string map_name[]; }; void EHLiveInit(EHLive &L,const string names) { EHInit(L.b); L.done=0; L.since=-1; L.day=-1; L.last_ticket=0; L.pos_n=-1; L.bal=0; L.full_ms=0; ArrayResize(L.map_magic,0); ArrayResize(L.map_name,0); string items[]; int n=StringSplit(names,',',items); for(int i=0; i