//+------------------------------------------------------------------+ //| DumpIndicator.mq5 | //| Copyright 2026, Allan Niñal | //| https://www.allanninal.dev/mql5 | //+------------------------------------------------------------------+ //| Test tool: writes every bar of a custom indicator's buffers, | //| with the bars it saw, for each symbol and timeframe, to | //| Common\Files\dump\__.csv | //| columns: time,open,high,low,close,b... (EMPTY_VALUE -> blank) | //| so a Python reference can be compared bar by bar. Read-only. | //+------------------------------------------------------------------+ // SPDX-License-Identifier: LicenseRef-PolyForm-Noncommercial-1.0.0 (see LICENSE) #property copyright "Copyright 2026, Allan Niñal " #property version "1.00" #property script_show_inputs #include input string InpIndicator = "SessionLevels\\SessionLevels"; // indicator path under MQL5\Indicators input string InpParams = ""; // parameters, "d:1.0|i:10|b:false" (empty = defaults) input string InpBuffers = "0,2,3"; // buffer indexes to write input string InpSymbols = "EURUSD,XAUUSD"; // symbols input string InpTFs = "H1"; // timeframes: M1,M5,M15,M30,H1,H4,D1,W1 input string InpTag = "dump"; // file name prefix input bool InpCloseWhenDone = false; // close the terminal when finished (batch runs) void OnStart() { int bufs[]; int nb=ParseInts(InpBuffers,bufs); string syms[],tfs[]; int ns=StringSplit(InpSymbols,',',syms),nt=StringSplit(InpTFs,',',tfs); int h=FileOpen("dump\\"+InpTag+"_DONE.txt",FILE_WRITE|FILE_TXT|FILE_ANSI|FILE_COMMON); for(int s=0; s0 && BarsCalculated(ind)==bars && SeriesInfoInteger(syms[s],tf,SERIES_SYNCHRONIZED)) break; Sleep(500); } MqlRates r[]; int got=CopyRates(syms[s],tf,0,bars,r); double b[][1]; string name=StringFormat("dump\\%s_%s_%s.csv",InpTag,syms[s],tfs[t]); int f=FileOpen(name,FILE_WRITE|FILE_TXT|FILE_ANSI|FILE_COMMON); string head="time,open,high,low,close"; for(int j=0; j