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.
What you need
| Requirement | Why | Notes |
|---|---|---|
| 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. |
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
run_studio.bat
Fastest to try. Needs Python + customtkinter + numpy + pandas on the machine.
build_exe.bat
Produces dist\FxMath LR Studio.exe plus its runner. Needs nothing on the target.
The standalone build produces two files
| File | What it is | Size |
|---|---|---|
FxMath LR Studio.exe | The GUI | ~48 MB |
FxMathLRStudioRunner.exe | A Python interpreter + numpy + pandas | ~45 MB |
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.
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.
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.
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.
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.
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.
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.
| # | Action | What it proves |
|---|---|---|
| 1 | FxMath LR Studio.exe --check | Repo, interpreter and MetaEditor found; the bundled runner can import numpy/pandas. |
| 2 | Settings → Test | The selected interpreter really has numpy and pandas. |
| 3 | Settings → pick a terminal | Install ↔ data-folder pairing, and that the deploy path is the MQL5 tree MT5 reads. |
| 4 | Settings → Detect from terminal | Live symbol list and broker suffix detection. |
| 5 | Data → an existing CSV → Validate | Subprocess spawn, UTF-8 pipe, log routing, verdict label. |
| 6 | Expert Advisor → Compile existing .mq5 | MetaEditor spawn, UTF-16LE log decode, .ex5 detection, and correct handling of MetaEditor's misleading exit code. |
| 7 | Full pipeline → Stop mid-search | taskkill /T: that no pool workers are left holding cores. |
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.
ALL SETS DONE and read the per-set table.Steps 2–6 can be replaced by a single Full pipeline → Run everything.
Common setup failures
| Symptom | Cause 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.