Run ONNX models in MetaTrader 5, on the GPU.
The deep, accurate playbook for traders who already have a model in Python and just need it to run — fast — inside an Expert Advisor. Export from PyTorch & Keras, wire up OnnxRun, force CUDA the right way, and fix the errors nobody else documents.
Train in Python. Run in MQL5. We cover every step.
No hand-waving. The actual path from a trained model to a live Expert Advisor — including the parts that break.
Train
Build your LSTM, CNN-LSTM or gradient-boosted model in Python on GPU.
Export
Convert to ONNX with the right opset and static sequence length to avoid export failures.
Integrate
Embed the model, set input/output shapes, and run it inside your EA on CPU or CUDA.
Backtest
Validate in the Strategy Tester — and fix the normalization bug that ruins results.
Everything from a trained model to a funded account.
Three technical pillars build the authority. Three commercial pillars pay the bills. Every tutorial links to the page that answers "okay, where do I run this?"
/onnx-mt5/
OnnxCreate → SetInputShape → OnnxRun, the new CUDA flags, profiling, and a sub-silo for every error message.
moat02/export/
Python → ONNX without the pain. PyTorch LSTM, Keras CNN-LSTM, tf2onnx, LightGBM — plus control-flow & dynamic-axes traps.
moat03/strategies/
ML as a filter, not a black box. Market-structure classifiers, trend filters, and the normalization bug in Strategy Tester.
revenue04/infrastructure/
Where to actually run it: GPU cloud vs forex VPS vs local workstation — and the math behind each.
revenue05/prop-firms/
Which funded-trader firms allow EA / ONNX bots in 2026 — rules, limits, and honest risk notes after the 2024 shakeout.
revenue06/brokers/
Crypto-algo edge: running an ONNX classifier on BTC candles, and the exchanges that fit an automated workflow.
The misconception worth a thousand clicks.
"Forex VPS with GPU" doesn't exist.
Forex VPS are sold on network proximity to the broker's matching engine — Equinix NY4, LD4, TY3. They are CPU-only. CUDA ONNX inference needs a physical NVIDIA GPU: a local workstation or GPU cloud. We say it plainly, then point you to what actually works.
Read the breakdown →GPU compute that handles ONNX inference.
Independent picks for training and running models. Every link is tracked so the guides stay honest about what people actually choose.
Affiliate disclosure: some links above are affiliate links. If you sign up through them we may earn a commission, at no extra cost to you. Recommendations are independent — see our disclosure page.
Get the new tutorials before anyone ranks for them.
One email when a new ONNX-in-MT5 guide drops — error fixes, export workflows, infrastructure breakdowns. No spam.