All Work
Machine Learning

Neural Network Trading Model

An LSTM neural network trained to predict short-term price direction from raw OHLC data, deployed directly into a MetaTrader 5 Expert Advisor for live trading.

A trained neural network deployed inside a MetaTrader 5 Expert Advisor, predicting short-term price direction from live market data

PythonMachine LearningLSTMMT5MQL5TensorFlow

The Brief

The client wanted to explore using machine learning directly inside their trading setup. The goal was a model that could learn from raw price data and output a directional prediction that an Expert Advisor could act on in real time.

What We Built

Data Pipeline A MetaTrader 5 script scrapes OHLC price and indicator data directly from charts and saves it in a structured format for training. This keeps the data consistent with what the EA sees during live trading.

LSTM Model We trained an LSTM neural network to predict whether price would close above or below the current close after the next five bars, using the last ten bars of OHLC data as input. The model was built with TensorFlow and exported to ONNX format for compatibility with MetaTrader 5.

MetaTrader 5 Expert Advisor An MQL5 Expert Advisor that loads the trained ONNX model and runs inference on live price data in real time. The EA uses the model’s output to make trading decisions, bringing the machine learning prediction directly into the execution layer.

Interested in a similar project?

Get in touch