Start here

Setup & First Run

Getting from nothing to a verified environment: the prerequisites, the two ways to launch, the four settings that matter, and the one command that proves the whole chain is wired correctly.

New here? The video covers setup and first run visually The 18-minute walkthrough includes the Settings tour and the acceptance test (chapter at 2:34 for the architecture, 10:21 for the first pipeline stage).

What you need

RequirementWhyNotes
MetaTrader 5 Compiling EAs, exporting OHLC, deploying Installed normally, e.g. C:\Program Files\MetaTrader 5. Any broker build works.
The LR-EA repository It contains the pipeline scripts the app drives The folder holding scripts\, data\ and logs\.
Python 3.10+ Only for source runs The built .exe carries its own interpreter — see below.
numpy, pandas The pipeline needs them Bundled inside the .exe; required for source runs.
customtkinter The GUI itself Source runs only.
pyinstaller Only to build the .exe Not needed to run anything.
Running the built .exe needs no Python at all The standalone build ships two executables: the GUI and a real CPython with numpy and pandas frozen inside. A target machine needs only MetaTrader 5 and the repository.

Install dependencies (source runs)

One command installs everything the GUI and the pipeline need:

py -m pip install customtkinter numpy pandas pyinstaller

The MetaTrader5 module is optional. It is needed only by the API-based downloader route on the Data page. If it is missing, that one route is unavailable and everything else works normally.

# optional — only for the API download route
py -m pip install MetaTrader5

Two ways to launch

Option A
From source
run_studio.bat

Fastest to try. Needs Python + customtkinter + numpy + pandas on the machine.

Option B
Standalone build
build_exe.bat

Produces dist\FxMath LR Studio.exe plus its runner. Needs nothing on the target.

The standalone build produces two files

FileWhat it isSize
FxMath LR Studio.exeThe GUI~48 MB
FxMathLRStudioRunner.exeA Python interpreter + numpy + pandas~45 MB
These two files must stay together The GUI shells out to the runner to execute every pipeline stage. Separating them means the app cannot run anything — it will report that the bundled interpreter is missing and ask you to pick a Python instead.

Copy both files into the repository root and double-click FxMath LR Studio.exe. Dropping the exe into the repo root is also how repo auto-detection works, so the app finds the pipeline by itself on first launch.

First run: the four settings that matter

The app opens on the Dashboard. If it could not locate the repository it offers to open Settings immediately. Settings has five cards; four of them matter on day one.

Repository

The folder containing scripts\ and data\. Detect re-runs discovery; a checklist shows which of scripts, data, logs and the output root actually exist.

Detection requires two specific files to be present before a folder counts as the repo: scripts/feature_search.py and scripts/gen_ea.py. Nothing else can substitute for them — they are the hard markers that distinguish the pipeline repo from any other folder of Python.

Pipeline interpreter

Two choices: Bundled with the app (the default for a standalone build — uses FxMathLRStudioRunner.exe, nothing to install) or A python on this machine.

Test runs import numpy, pandas through whichever interpreter is currently selected — not through whatever is on PATH. That distinction matters: it is the only check that proves what will really happen when a stage runs.

MetaTrader 5

The card worth reading carefully. Detected terminals lists every install found on the machine, each labelled with its broker server — for example AMarkets - MetaTrader 5 (AMarkets-Demo).

Choosing a terminal sets both the install folder and its data directory, and shows exactly which MQL5\Experts deployments will land in. This matters because two installs on the same machine keep entirely separate %APPDATA% data folders — pick the wrong one and you will compile successfully into a terminal you never look at.

Rescan re-scans; Browse accepts a folder by hand and still resolves its data directory by reading that folder's origin.txt.

Symbol & broker suffix

Brokers decorate instrument names. An AMarkets account lists XAUUSD as XAUUSDb. The pipeline works exclusively in the clean name (XAUUSD) for filenames and output folders; the suffix is applied only when talking to the terminal.

Detect from terminal reads the live symbol list and fills the suffix in. List instruments shows the closest matches plus the detected suffix — the quickest way to settle "what is this called here?".

The card also shows the effective symbol that will be sent to MT5, next to the clean name used for files, so the two can never be confused.

Press Save settings when done.

Where settings live In settings.json next to the app (or next to the exe). Stale values are repaired on load: a repo or python path that no longer exists is re-detected, use_wine follows the platform so a settings file copied from Linux cannot make a Windows install shell out to wine, and a mt5_data_dir belonging to a different terminal is corrected — so a deploy cannot silently target the wrong terminal.

Verify the wiring without opening a window

This is the single most useful command in the whole system. Run it before anything else, and again whenever something looks wrong.

# source run
run_studio.bat --check

# or directly
py FxMath_LR_Studio\run.py --check

It resolves and prints the repository, the interpreter (and, for a standalone build, whether the bundled interpreter can genuinely import numpy and pandas), the MetaEditor and terminal paths, every MT5 terminal found, whether compiling and downloading are possible, each pipeline stage's state, any staleness warnings, and the exact command for every step a full run would execute.

It separates "misconfigured" from "pipeline bug" in one screen. A windowed .exe has no console, so when you pass --check to it the report is written to fxmath_lr_studio_check.txt next to the executable and also shown in a dialog.

What good output looks like

FxMath LR Studio 1.0.0
  repo        : C:\...\LR-Studio-Repo-Windows  [ok]
  frozen      : True
  interpreter : bundled (FxMathLRStudioRunner.exe)   [bundled]
  bundled exe : C:\...\dist\FxMathLRStudioRunner.exe
  bundled ok  : python 3.13.5 2.4.6 3.0.1
  mt5 dir     : C:\Program Files\AMarkets - MetaTrader 5
  mt5 data    : C:\Users\...\MetaQuotes\Terminal\D0694EE...CE8
  mql5 root   : C:\...\Terminal\D0694EE...CE8\MQL5
  metaeditor  : C:\Program Files\...\metaeditor64.exe
  terminal    : C:\Program Files\...\terminal64.exe
  use wine    : False  (wine missing)
  can compile : True
  can download: True
  symbol/tf   : XAUUSD -> XAUUSDb M5   cores 2
  terminals   : 2 found
    * C:\Program Files\AMarkets - MetaTrader 5 | AMarkets-Demo | data yes
      C:\Program Files\AMarkets - MetaTrader 5 - Copy | AMarkets-Demo | data yes
  output root : strategies_lr_m5
    data     done     10,000 bars · med spread 12.0
    search   done     11 sets
    build    done     ALL9 · 9 slots · NP +6,200
    hours    done     11 windows
    holdout  done     8 run(s)
    ea       done     3/3 compiled
    report   done     4 file(s)
  step 1: ...python.exe ...\scripts\feature_search.py --engine lr --symbol XAUUSD --tf M5 --set all --cores 2
  step 2: ...build_allstar.py --engine lr --symbol XAUUSD --tf M5 --all9 --cores 2
  ...

--check exits 0 when a valid repo was resolved and 2 otherwise, so it can gate a build script or a CI step.

Read the "bundled ok" line first On a standalone build, bundled ok : python 3.13.5 2.4.6 3.0.1 proves the frozen runner really started and really imported numpy and pandas. If that line is missing or the runner is not found, no pipeline stage will run — fix that before anything else.

The five-minute acceptance test

On a new machine, these seven checks exercise nearly every OS-specific code path. Each one targets a different failure mode.

#ActionWhat it proves
1FxMath LR Studio.exe --checkRepo, interpreter and MetaEditor found; the bundled runner can import numpy/pandas.
2Settings → TestThe selected interpreter really has numpy and pandas.
3Settings → pick a terminalInstall ↔ data-folder pairing, and that the deploy path is the MQL5 tree MT5 reads.
4Settings → Detect from terminalLive symbol list and broker suffix detection.
5Data → an existing CSV → ValidateSubprocess spawn, UTF-8 pipe, log routing, verdict label.
6Expert Advisor → Compile existing .mq5MetaEditor spawn, UTF-16LE log decode, .ex5 detection, and correct handling of MetaEditor's misleading exit code.
7Full pipeline → Stop mid-searchtaskkill /T: that no pool workers are left holding cores.
How to read step 7 Watch Task Manager while the search runs: you should see one parent process plus several pool workers. Press Stop and confirm they all disappear within a second or two. If any remain, taskkill is being blocked — most often by anti-virus.

Your first real run

Once the acceptance test is clean, walk the pipeline in order. Resist the temptation to hit Run everything first — the individual pages show you the intermediate results you need to judge whether the run is worth continuing.

Data
Export bars from the terminal, import the CSV, and confirm the validator says no problems found. Check the median spread tile — it drives every cost figure downstream.
Optimize
Start the search. This is the long pole — tens of minutes across 11 sets. Wait for ALL SETS DONE and read the per-set table.
Portfolio
Build ALL9. Then check the share column and the per-slot curves for concentration — a single slot dominating the book is the thing to catch here.
Trading hours
Find best hours, then read the verdict. If most sets are out-of-sample negative, plan to ship the 24-hour EA instead.
Holdout
Run warm, then cold. Both should be positive. If neither is, stop and investigate before compiling anything.
Expert Advisor
Generate and compile. You want 0 errors, 0 warnings and no STALE badge.
Reports & deploy
Generate all three reports, read the 24h-vs-compiled-window section before deciding, then deploy and refresh the Navigator in MT5.

Steps 2–6 can be replaced by a single Full pipeline → Run everything.

Common setup failures

SymptomCause and fix
"Repo: not set" everywhere The repository folder is missing or misplaced. Point Settings → Repository at the folder containing scripts\feature_search.py.
"MetaEditor64.exe not found", compiling disabled The wrong terminal is selected, or it was never installed. Use Settings → Browse to point at the install folder that contains metaeditor64.exe.
Compiled EA does not appear in MT5 The app deployed into a different terminal's data directory than the one you are looking at. Check the MQL5\Experts path shown on the Settings card, then refresh the Navigator in MT5.
Log shows or ? instead of ·/ An encoding mismatch. The app pins UTF-8 on both sides of the pipe; if you see this, a launcher has overridden PYTHONIOENCODING.
Antivirus or SmartScreen blocks the exe A PyInstaller binary is a common false positive. Allow the file, or run from source instead.

Full failure catalogue: Troubleshooting.