Dissertation · BSc Computer Science (AI) · 2021–25

Combining deep neural networks and machine learning to forecast financial markets

My final-year research at Heriot-Watt University Dubai. Scroll to walk through it, chapter by chapter.

A towering wave curls over three boats, with Mount Fuji small in the distance
“Who can make the muddy water clear? Let it be still, and it will gradually become clear.”
— Laozi
Katsushika Hokusai·The Great Wave off Kanagawa·c. 1831
01The question

Can an accurate model also be a profitable one?

Most forecasting research optimises error metrics such as RMSE and R². This study evaluated models on both predictive accuracy and their returns in simulated trading.

Why it matters

Models judged on accuracy alone can score well and still lose money once deployed. Evaluating forecasts against financial outcomes ties model performance directly to profit and loss, and gives leaders a sound basis for investment decisions.

AccuracyProfitTHIS RESEARCH
02The data

Two decades of market data

Hourly EUR/USD price data from 2003 to 2024, enriched with engineered technical indicators. Time-series cross-validation with a sliding window kept every test strictly on data the model had never seen.

Why it matters

Look-ahead bias and overfitting are leading reasons strategies that excel in backtests fail in live markets. Validating strictly on future data reduces the risk of committing capital to results that cannot be repeated.

Fold 1
Fold 2
Fold 3
Fold 4
train test
03The contest

Every architecture, head to head

Recurrent neural networks (GRU and LSTM), Transformers, Bayesian variants and hybrid models were benchmarked against each other, alongside gradient-boosted trees for predicting market direction.

Why it matters

Systematic benchmarking ensures the chosen model is selected on evidence. It also avoids investing in complex architectures where simpler models perform as well, lowering compute, maintenance and model-risk costs.

Close price · forecast accuracy

GRU
Bayesian Transformer-GRU
Transformer-GRU
LSTM
GRU-LSTM hybrid

Market direction · reliability

Transformer
GRU
XGBoost
04The hybrid

Two specialists and a risk manager

The final system splits the problem. An XGBoost classifier predicts market direction, a GRU-LSTM network forecasts the closing price, and the Kelly Criterion sizes each position according to the model's confidence.

Why it matters

Assigning each task to the best-suited model improves overall reliability. Confidence-based position sizing limits exposure when signals are weak, protecting capital in volatile periods while preserving upside when conviction is high.

Hourly data+ indicatorsXGBoostdirection ▲▼GRU-LSTMclose priceKellyposition size
05The result

A 29% return on unseen market data

In out-of-sample backtesting, short holding periods were dominated by market noise, while a longer decision horizon delivered a 29% return.

Why it matters

Short holding periods mean more frequent trading, which increases transaction costs and exposure to noise. Aligning the decision horizon with the strength of the signal preserved returns, a principle that applies to any business acting on model predictions.

3-hour
↓ Loss
4-hour
↓ Loss
24-hour
↑ Profit

accumulated multi-timeframe test

Findings

What the research found

01

Hybrid architectures generalise better than single models

Combining deep neural networks with gradient-boosted models produced more stable results across time-series validation than any single architecture.

02

Problem framing and feature engineering outweigh model complexity

Choosing the right prediction target and engineering the right features mattered more than adding model complexity.

03

Decision horizon drives returns

With confidence-based position sizing, short horizons were lost to market noise, while longer horizons delivered a 29% return on out-of-sample data.