//+------------------------------------------------------------------+ //| VtDump.mqh | //| Copyright 2026, Allan Niñal | //| https://www.allanninal.dev/mql5 | //+------------------------------------------------------------------+ //| Test helper (not used by the indicator): writes every number the | //| card shows as "keyvalue" lines, the format | //| tests/check_core.py compares with its Python twin. | //+------------------------------------------------------------------+ // SPDX-License-Identifier: LicenseRef-PolyForm-Noncommercial-1.0.0 (see LICENSE) #ifndef VTDUMP_MQH #define VTDUMP_MQH #include #include int g_out=INVALID_HANDLE; void W(const string k,const double v) { FileWriteString(g_out,StringFormat("%s\t%.17g\n",k,v)); } void WI(const string k,const long v) { FileWriteString(g_out,StringFormat("%s\t%I64d\n",k,v)); } void WS(const string k,const string v) { FileWriteString(g_out,k+"\t"+v+"\n"); } int TypeOf(const string s) { return(s=="buy" ? VT_T_BUY : (s=="sell" ? VT_T_SELL : (s=="cash" ? VT_T_CASH : VT_T_CREDIT))); } int EntryOf(const string s) { return(s=="in" ? VT_IN : (s=="out" ? VT_OUT : (s=="inout" ? VT_INOUT : VT_OUTBY))); } void DumpEngine(CVtEngine &e,const long now,const double bal,const long &jd[],const double &jm[],const double &jp[],const int jn) { e.Report(now,bal,jd,jm,jp,jn); WI("ntrades",e.ntr); W("S0",e.s0); for(int i=0; i