Regional notice (EN-SG): Singapore readers: MAS heavily regulates retail crypto derivatives — Bybit derivatives restricted for retail. Prop firms accept SG residents but verify each. Retail CFD trading is restricted.
Home/Export to ONNX
Pillar 02 · train in Python, ship to MQL5

Python → ONNX without the RuntimeError.

If you've tried to export a PyTorch LSTM and watched the export crash on a control-flow op, you're not alone — that bug has been live since 2019 and the workarounds aren't obvious. This silo documents the export workflow that actually lands a working .onnx file inside MetaTrader 5.

// before you start

A working environment.

Training a model on GPU is faster, cheaper, and avoids the most common "this took 18 hours and crashed" failure. If you don't have an NVIDIA card locally, the cloud is hourly and cheap for training runs.

Affiliate disclosure: some links above are affiliate links. We earn a commission if you sign up — the recommendations are independent. See our disclosure page.