Discussing the article: "CSV Data Analysis (Part 8): Building an SQLite Strategy Registry from Accumulated CSV Exports"

 

Check out the new article: CSV Data Analysis (Part 8): Building an SQLite Strategy Registry from Accumulated CSV Exports.

Flat files work well at the start of an MQL5 research pipeline, but they hinder cross-run queries and provenance once the archive grows. We build a Python-based SQLite registry that ingests CSV exports with SHA-1 deduplication, records EA version and run timestamps, applies forward-only schema migrations, and indexes common filters. You get a structured query layer for fast lookups, robustness checks, and version comparisons across all campaigns.

The CSV-based pipeline built across Parts 1 through 7 is well-suited to the natural rhythm of a single research campaign: run an optimization sweep, export a result file, process it with Python, draw conclusions, and move on. For that workflow, flat files are not just adequate — they are optimal. They require no infrastructure, open in any text editor, and load into pandas with a single function call.

The structural limitations of flat files emerge at a different scale. After six months of active strategy development across multiple instruments, timeframes, and indicator variants, the research directory typically contains dozens of CSV files from dozens of separate campaigns. Finding all EURUSD H1 results where the SAMA filter period was between 10 and 20 and the Sortino Ratio exceeded 1.5 requires either manually scanning multiple files or writing an ad-hoc script to concatenate them first. CSV files do not preserve run history after the session ends. They cannot reliably show which parameter set was tested in which run, which EA version produced a row, or when a result was first observed and later replicated.

Three specific failure modes emerge as the flat-file archive grows. The first is query friction: there is no way to ask a structured question across multiple files without writing a script that loads all of them into memory simultaneously. On a machine with modest RAM, a large archive may not fit at all. The second is provenance loss: each CSV file contains its result rows but carries no reliable record of when it was produced, which EA version generated it, or which optimization run it belongs to. Once a file is renamed, moved, or its timestamp overwritten, that context is permanently gone. The third is duplication without detection: if the same optimization run is accidentally exported twice into files with different names, both copies will be loaded and double-counted in any analysis, silently corrupting the results.

An SQLite registry resolves all three failure modes in a single artifact. It provides a single, queryable store for every result row ever exported from the MQL5 pipeline, indexed for fast retrieval, with full provenance metadata recording when each row arrived and which export file it came from. Adding a new export file is a single function call. Querying across all historical results for any combination of filters is an SQL statement. The database is a single portable file. It can be backed up, versioned, or shared with collaborators using only Python's standard library.

Building an SQLite Strategy Registry from Accumulated CSV Exports

Author: Ushana Kevin Iorkumbul