Reference

Glossary

Every term, abbreviation and metric used in the app, the pipeline output and the reports — including the ones that mean something specific here rather than their usual meaning.

Build types

ALL9
The canonical nine-slot portfolio: base9, momentum, volatility, price_action, trend, full15, micro, voltrend, meanrev — one slot each. The main book the app optimises.
ALL6
The first six of those only — the original sets, before the three experimental additions.
allstar
Pools all slots from a preferred set list, ranks by score and takes the top 5 with at most one slot per set. This is the default mode when no flag is given.
best5
The --exclude mode's folder. Drops named sets and takes the rest.
topN
The N best-scoring sets on disk, one slot each.
24X
A build tag meaning "24 hour" — every slot's InpSlot<N>Hours is empty, so no session filter. Written as …_ALL9_24X_M5.mq5 so it cannot overwrite the hours build.
NOBE
"No break-even, no trailing" — the default build. Both features exist in the engine but are off, matching what the pipeline generates.

Engine parameters

lookahead
The label horizon in bars: the model predicts whether close[k + lookahead] > close[k]. Also the lag used by online learning. Searched over 2, 3, 5, 8.
sl_mult
Stop-loss distance as a multiple of ATR(14). Searched over 1.5, 2.0, 2.5, 3.0.
rr
Take-profit as a multiple of the stop distance. Searched over 1.0, 1.5, 2.0, 3.0. An rr of 2.0 means the target is twice as far as the stop.
training_bars
Length of the rolling training window. Also sets warmup. Searched over 500, 1000, 1500.
retrain_interval
How often the batch training is repeated. Weights are reset to zero and re-fitted from scratch — not warm-started. Searched over 250, 500, 1000.
batch_lr
Gradient-descent learning rate for batch training. Searched over 0.005, 0.01, 0.02.
online_lr
Learning rate for the per-bar online SGD step. Default 0.005.
long_thresh, short_thresh
Probability thresholds for taking a long or a short. Between them, no trade. long_thresh is searched over 0.50, 0.55, 0.60; short_thresh defaults to 0.45.
max_iter
Gradient-descent iterations. 600 during the search, 2000 everywhere else — the search and full-budget runs deliberately differ.
lam
L2 regularisation strength. 0.001, mirrored in the EA as #define LAM 0.001. Any change must be made in both places.
warmup
training_bars + 1. The bar at which the first batch train happens and trading can begin. Different slots have different warmups, which is why equity curves need alignment.
FEATURE_LOOKBACK
51 bars — long enough for the longest feature window (a 50-bar SMA or ATR reading at offset 50). Mirrored in the validator's trainability check and in the EA.
MAX_TRAIN
1800 — the EA's training buffer size, covering the largest training_bars (1500) plus the largest lookahead (8) plus FEATURE_LOOKBACK (51), with headroom.

Search internals

Stage 1
64 combinations of sl_mult × rr × lookahead, at max_iter = 600.
Stage 2
81 combinations of training_bars × retrain_interval × batch_lr × long_thresh, run for each of the top 3 diverse stage-1 survivors — 243 runs.
diverse top-3
The three best stage-1 results after de-duplication on the entire (sl_mult, rr, lookahead) tuple. Prevents stage 2 searching one neighbourhood three times.
Verification
The top 40 merged candidates re-run at the full max_iter = 2000. Only survivors of this pass are eligible for selection.
N_SLOTS
5 — maximum slots selected per feature set.
MAX_CORR
0.85 — the correlation threshold in the slot filter.
Correlation filter
Greedy slot selection rejecting a candidate whose first-differenced equity correlates above MAX_CORR with an already-picked slot. Needs ≥30 overlapping points and a denominator above 1e-12.
Fallback
If the filter cannot fill 5 slots, the remainder are filled by best score ignoring correlation.

Metrics and abbreviations

NP — net profit
equity[-1] − equity[0], in dollars at 0.01 lot per slot. Gross — spread is not charged on fills.
DD — max drawdown
The minimum of (equity − running_peak) / peak as a percentage. Reported as a negative number. Computed on the equity curve, not on closed trades.
PF — profit factor
gross_profit / gross_loss, denominator floored at 1e-10. Above 1.0 means profitable. The acceptance test requires > 1.0.
WR — win rate
wins / trades × 100.
T — trades
Number of closed trades. The acceptance floor is 30.
B / S — buys / sells
Direction split of closed trades.
S — Sharpe
Annualised from per-bar equity returns. Read it as a comparison between slots in the same run, not as an absolute annualised Sharpe — the annualisation assumes a 24/7 minute-bar calendar.
score
net_profit / (1 + |max_dd_pct| / 100). The search's ranking device. Failing candidates are scored -1e18.
ok
The acceptance test: trades ≥ 30 AND profit_factor > 1.0.
PnL/t
Net profit per trade.
Return / DD
Net profit divided by maximum drawdown — a rough reward-for-risk ratio.
Two abbreviations collide S means Sharpe in the metrics tables but sells in the B/S column of the tail report's slot rows. Context distinguishes them.

Money and costs

fixed_lot
0.01 — one micro-lot, used everywhere. All dollar figures are at this size per slot.
lot_mult
Converts a price move into money: XAUUSD 100, EURUSD 100000, DowJones30 1. The EURUSD value is asserted to within 5% of $0.10 per pip at 0.01 lot.
initial_balance
10000.0 — the notional the equity curve starts from. All drawdown percentages are relative to it.
POINT_DOLLARS
0.01 — dollars per point per 0.01 lot. The cost convention: cost = spread × trades × POINT_DOLLARS.
max_spread
The median of the data file's spread column, stored in every summary. It is the cost basis for every report.
Gross vs net of spread
The engine's P&L is gross. Reports estimate cost from the median spread and always show raw and net figures side by side.
Spread not charged on fills
The simulator does not subtract spread per trade; it is applied as an aggregate cost estimate afterwards. This is why a zero spread column is a fatal data error.

Slots and magic numbers

Slot
One independently-trained position within a feature set. Five per set, nine in the ALL9 book. Each has its own magic number, parameters and equity curve.
Magic number
A unique integer identifying a slot's positions on the account. Built as LR_MAGIC_BASE[set] + TF_offset + slot_index.
magic_start
The first magic in a set's range (301 for base9). The LR base is magic_start + 100.
TF offset
A per-timeframe shift (M1 +4000, M5 +0, M10 +3000, M15 +1000, M30 +5000, H1 +6000, H4 +7000, D1 +8000, M2 +2000) so several timeframes can run on one account.
Position scan
The EA matches its own positions on magic and symbol — the reason two symbols can share a magic without conflict.

Feature sets

SetAbbrIdea
base9BASThe baseline: short-horizon returns, volatility, time-of-day, bar shape.
momentumMOMMulti-horizon returns only.
volatilityVOLVolatility state and relative volatility.
price_actionPACandle structure: bodies, wicks, close position.
trendTRDMoving-average relationships and distance from the average.
full15FULA 15-feature union of the momentum, volatility and price-action ideas.
microMICVery short horizons — 1, 3 and 5 bar returns.
voltrendVTVolatility ratios combined with return context.
meanrevMRReversion: distance from averages, RSI, momentum divergence.
mafanMAFMoving-average fan alignment across 5/9/20/50.
breakoutBRKDistance to 50-bar extremes.
FEATURE_SETS
The dictionary defining all eleven, in scripts/feature_sets.py. The app reads it by parsing the AST — never importing it — so a syntax error in the script cannot stop the window from opening.
Primitive
A single derived indicator (e.g. atr14, body_ratio, ma_cross). Sets are lists of primitives.
union_features
The full feature list a set uses, recorded in its summary.
_MQL_EXPR
The MQL5 expression mirror of each primitive, used by the generator to emit exact equivalents.

Hours and sessions

Server time
The broker's clock, which is what every hour figure in this system uses. Not UTC. Typically UTC+3 for a European broker. Getting this wrong shifts every hour feature and window silently.
Hour spec
A compact string of allowed hours: "" (all), "4", "8-10" (inclusive), "22-2" (wrap-around), "4,8-10" (union).
InpSlot<N>Hours
The EA input holding a slot's hour spec, baked in at generation time.
eval_hours / hours
The engine parameter gating entries only. Training reads a separate mask.
train_hours
A separate mask restricting which bars are used for training. Independent of the entry gate — the property that makes exact hour-subset replay possible.
hour_pnl
Per-hour P&L histogram, keyed "0""23", attributed to the trade's entry hour.
Contiguous cyclic window
A block of 2–6 consecutive hours, allowed to wrap past midnight. 120 candidates exist.
in_pnl / oos_pnl
A window's P&L on the first and second half of the bars. The second half was not used to choose the window. Note: the ranking used the whole sample, so this is a stability check rather than a true holdout.

Holdout

Tail
The last N bars, set aside as unseen data. tail_start = n_bars − tail. Default 2,500 bars; must leave at least 1,000 bars of pre-tail history.
Warm
The model learns and re-trains normally from bar 0, but opens no new positions before tail_start. Mirrors a live EA that has already been running.
Cold
No learning at all until tail_start, then one batch train on the pre-tail window, then normal online learning. The strictest test.
_trade_from
The engine hook implementing "no new entries before this bar".
_cold_start
The engine hook suppressing learning until _trade_from.
record_signals
A mode that collects raw entry signals instead of simulating trades, without holding a position. Enables exact hour-subset replay.
In-sample
Data that was used to choose the configuration. Every figure from stages 2–4. An optimistic upper bound by construction.
Out-of-sample / OOS
Data that did not influence the choices. Only the tail holdout truly qualifies.
Curve-fitting / overfitting
Selecting configurations that look good on data by exploiting its noise rather than a real effect. Detected by a negative holdout.
Exact replay
Re-running the model for each hour configuration rather than filtering a trade list. Necessary because gating entries changes which trades exist, not merely which are counted.

Data

OHLC
Open, High, Low, Close — the four prices per bar.
Tick volume
The broker's count of price updates, not true traded volume. Present in the CSV as tick_volume.
Real volume
Genuine traded volume where the broker supplies it; frequently zero for forex. Present as real_volume.
Spread column
Per-bar spread in points. Its median becomes the cost basis. Zero-filled spread is treated as a fatal data error.
Modal inter-bar step
The most common gap between consecutive timestamps in minutes. The validator compares it to the timeframe in the filename to detect a mislabelled file.
Server-time offset
Hours added to UTC timestamps from the API. Default 3.0. The terminal-side exporter needs none.
Trainability floor
1,559 bars — MAX_TRAINING_BARS (1500) + MAX_LOOKAHEAD (8) + FEATURE_LOOKBACK (51). Below this the longest training window cannot be filled.

Broker and terminal

Clean name
The undecorated instrument, e.g. XAUUSD. Used for every filename, folder and feature.
Broker symbol / suffix
What the terminal calls it, e.g. XAUUSDb, so the suffix is b. Applied only when talking to the terminal.
MT5_DATA_DIR
Environment variable passed to every job, naming the selected terminal's data directory so the downloader and exporter do not guess.
MT5_TERMINAL
The selected terminal's executable path.
origin.txt
A file in each MT5 data directory recording which install it belongs to. This is how installs are paired with their data folders.
MQL5\Experts
The folder inside a terminal's data directory where compiled EAs must be placed to be usable.
MetaEditor
The MQL5 compiler. Driven directly, not through a shell. Returns exit code 1 even on a clean compile.
.mq5 / .ex5
MQL5 source and its compiled binary. A stale .ex5 next to a newer .mq5 is reported as an error.
wine
The compatibility layer that lets the Windows MetaTrader5 Python module run on Linux. Required for the API downloader on non-Windows hosts.

App internals

Task
A description of one pipeline invocation: argv, working directory, environment, label, tag and metadata. Knows nothing about execution.
JobManager
Owns the single running job. Streams output through a queue, exposes cancellation, keeps a bounded history.
Chain
Runs a list of tasks in order, stopping at the first non-zero exit. Saves and restores the manager's completion handler.
Presets
The factory for every command line the app can build. Both the individual pages and the full chain use it, which is why they produce identical commands.
marshal
The hand-off that routes a completion callback from the pump thread onto the GUI thread. Without it, touching Tk off-thread is an access violation on Windows.
Ring buffer
The 6,000-line cap on log history, bounding memory during a long search.
Process group kill
Killing the child and its descendants. taskkill /T on Windows, os.killpg on POSIX.
FxMathLRStudioRunner.exe
A frozen CPython with numpy and pandas inside, built from pyrunner.py. The GUI invokes it exactly as it would invoke python.exe, which is what makes a distributed build need no Python installed.
Stale
An artefact that exists but whose input is newer than it. Reported amber for most stages, red for the EA.
Output root
strategies_lr_m5 for XAUUSD, else strategies_<symbol>_<tf>. Everything a run produces lives under one.

Statistics notes

Some conventions here differ from the classical definitions
  • ATR is a simple moving average of true range, not Wilder smoothing.
  • RSI(14) uses a simple average of gains and losses, not Wilder smoothing.
  • Sharpe annualises with a 24/7 minute-bar calendar against the actual bar count. Comparable between slots, not an absolute annualised figure.
  • Max drawdown is computed on the equity curve including open positions, not on closed trades.
  • Intrabar resolution always assumes the stop was hit when a bar spans both levels. Conservative, and deliberately so.
  • dow follows pandas' Monday=0 convention. The MQL5 mirror converts from MetaTrader's Sunday=0.