//+------------------------------------------------------------------+ //| VitalsDump4.mq4 | //| Copyright 2026, Allan Niñal | //| https://www.allanninal.dev/mql5 | //+------------------------------------------------------------------+ //| Test EA (read-only), run in the MT4 Strategy Tester. Mode 0: runs| //| VtCore/VtExposure on the synthetic cases tests/check_core.py | //| wrote to the tester's files folder (vttest\deals_.csv, | //| meta_.csv, jr_.csv, pos_.csv) and writes every number | //| the card shows to out_.txt, plus the pip check (out_pip.txt). | //| Mode 1: the journal test (see VtJournal.mqh) on scripted paths. | //+------------------------------------------------------------------+ // SPDX-License-Identifier: LicenseRef-PolyForm-Noncommercial-1.0.0 // Required Notice: Copyright 2026 Allan Niñal (https://www.allanninal.dev/mql5) #property copyright "Copyright 2026, Allan Niñal " #property link "https://www.allanninal.dev/mql5" #property version "1.00" #property strict #include #include #include #include input int InpMode = 0; // 0 core cases, 1 journal paths input int InpCases = 8; // cases 0 .. n-1 bool ReadLines(const string name,string &lines[]) { ArrayResize(lines,0); int f=FileOpen(name,FILE_READ|FILE_TXT|FILE_ANSI); if(f==INVALID_HANDLE) return(false); FileReadString(f); // header int n=0; while(!FileIsEnding(f)) { string s=FileReadString(f); if(StringLen(s)==0) continue; ArrayResize(lines,n+1,1024); lines[n++]=s; } FileClose(f); return(true); } void RunCase(const int k) { string L[],v[]; // meta long now=0,f_start=0,f_magic=-1; double bal=0; string f_symbol="",f_comment=""; if(!ReadLines(StringFormat("vttest\\meta_%d.csv",k),L)) { PrintFormat("VitalsDump: meta_%d.csv missing",k); return; } for(int i=0; i0) FileWriteString(h,s+"\n"); } FileClose(f); } void VtJournalSelfTest() { string L[],v[],jf="Vitals\\FDD_test.csv"; FolderCreate("Vitals"); FileDelete(jf); if(FileIsExist("vttest\\jt_seed.csv")) { if(!FileCopy("vttest\\jt_seed.csv",0,jf,FILE_REWRITE)) PrintFormat("VitalsDump: seed copy failed, error %d",GetLastError()); } if(!ReadLines("vttest\\jt_paths.csv",L)) { Print("VitalsDump: jt_paths.csv missing"); return; } int h=FileOpen("vttest\\journal_out.txt",FILE_WRITE|FILE_TXT|FILE_ANSI); CVtJournal *j=new CVtJournal; j.Init(jf,0); int snap=0; for(int i=0; i