NN Lab

Train the network. Let the strategy search judge it.

An SQX app plugin that trains four network families and writes one model file. StrategyQuant blocks and MetaTrader 5 both run a forward pass of the same weights, so parity becomes a question about two readers of one file instead of two trainings that can never agree.

  • StrategyQuant X
  • MetaTrader 5 to deploy
  • MLP · CONV · LSTM · CONVLSTM
  • Trained in Java
The NN Lab Training tab in StrategyQuant X showing a neural network training run with progress and accuracy figures.
Screenshot coming: A training run in NN Lab
A training run in NN Lab
The NN Lab Autopilot search result ranking learning rate, optimiser, batch size and L2 settings, with the winning trial at the top.
Screenshot coming: Auto tune ranking
Auto tune ranking
Data check

Told about gaps before you train

Training on history with holes teaches a network a price path that never existed, and a stitched-together series shortens every window the features read. NN Lab checks the charts you picked before each run.

It never blocks a run. If the history has gaps, a Data quality panel on the module’s Progress, Data and Autopilot views says how many minutes are missing and why it matters for the precision you chose, and offers one button, Make a patched copy. That fills short holes (up to 15 bars) with flat, zero-volume bars at the previous close, imports the result as <symbol>_patched and leaves the original untouched. Longer outages are reported and left alone. Every filled minute is written to an audit log. When part of the history was imported at a coarser resolution than M1, NN Lab also suggests the longest clean date range as a one-click setting. This is a light version of GapSmith: the same fill rules, built into this module for the symbol on its Data tab. GapSmith itself adds a Fix gaps button to the Data Manager’s Analyze data quality view, for any symbol, without needing this module.

The Data quality panel in NN Lab warning that a symbol has serious gaps, with buttons to make a patched copy or use the longest clean date range.
Screenshot coming: The Data quality panel before a run
The Data quality panel before a run
What it does

A GUI over a file format

NN Lab trains models and writes them. It knows nothing about trades, strategies or profit. Anything that can read its .awnn files can use the output; today that is the NN indicator blocks that ship with it.

  • Four model families: perceptron (MLP), convolutional (CONV), LSTM and CONVLSTM, each as an SQX indicator with condition blocks and a matching MT5 indicator.
  • Three-class output: long, short, neutral via softmax, reduced to a signed Signal (−1 to 1) and a Confidence.
  • Pivot labels from a confirmed zig-zag turning point ahead of each bar.
  • Inputs you choose: built-in features, SQX blocks, and Alternative Data columns, recorded in the model so the block reads the same definition it trained on.
  • Adam or SGD with momentum, per-chart or pooled models, fixed seed so a configuration reproduces its weights exactly.
Neural network topologyInput features feed two configurable hidden layers and a three-class softmax output: long, short, neutral. LongNeutralShort featureshidden 1hidden 2softmax
Fig. 1 — Topology is configurable per model: input features, hidden layers, and a 3-class softmax head. Illustrative sizes.
The one mistake that matters

Out-of-sample data is never touched

If the network sees bars that later fall inside a StrategyQuant out-of-sample window, every strategy built there is validated on data the network memorised, and nothing in the report looks wrong.

Data split: NN train, purge, NN validation, reserved tail for SQX out-of-sample NN train purge NN validation reserved for SQX OOS dropped: never trained, never scored time →
Fig. 2 — The reserved tail is dropped, not scored. A purge gap removes samples whose label resolves past the split. NN Lab deliberately computes no number on the reserved tail, because a number there would eventually be optimised against.
Reading results

Honest metrics, a fixed judge

Balanced accuracy vs chance

Mean per-class recall against a 0.3333 baseline, with a caveat shown beside the number: adjacent bars share most of their label window, so the effective sample size is far below the nominal count.

Autopilot ranked by a fixed scorer

Autopilot’s topology and label searches are ranked by the Spearman rank correlation between signal and ATR-normalised forward return on the same bars for every trial. Ranking on a model’s own labels would be circular.

Every trial is kept

Configuration, losses, scores and wall time are written for each trial, so a sweep that reports only its winner cannot hide a lucky one.

Scope, on purpose

NN Lab selects a model. It does not score a strategy, see a trade, or form an opinion about profit. StrategyQuant’s robustness checks are what judge the strategy built on top. There is no triple-barrier labelling or exotic machine learning here.

Deployment

Weights are compiled in

SQX: nothing to do. Models are picked up from the models folder; tick the AW NN-<Family> condition blocks in the Builder and set ModelId.

MetaTrader 5: the Models tab has a Deploy to MetaTrader 5 button. NN Lab writes a small model file (.awnnm, checksummed) beside each model and the button copies it to the MetaTrader Common folder, Common\Files\AWNN, which every terminal on the PC shares. The NN indicators ship compiled and read that file at run time, so the PC that trades needs no source, no MetaEditor and no compile step. A missing, damaged or newer-format file prints one clear message in the Experts log and the indicator stays neutral instead of trading on garbage; retraining over a live chart is picked up on the next bar.

What a model needs: its .awnnm file in Common\Files\AWNN (written by the Deploy to MetaTrader 5 button; copy it there by hand on a PC that has no NN Lab). Known limitation: a model whose inputs are sourced from other AW blocks reads those blocks’ indicators at run time, and in the MT5 Strategy Tester this may need extra setup (the feature indicators and data available to the tester agents). Run a short tester pass and check the Experts log for the model message before trusting a backtest.

Other platforms

MetaTrader 5 only. MetaTrader 4, JForex, EasyLanguage and PseudoCode templates are labelled stubs and are not supported.

Build on the charts the model was trained on, and keep the build’s out-of-sample range inside the window reserved on the Data tab.

Licence

NN Lab

See pricing · also included in the Suite

Risk

Software output is not investment advice and says nothing about future results. Validate every strategy yourself before risking capital.