Skip to content

Mubarraqqq/eurusd-forecasting-ann-arima

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ˆ EUR/USD Forex Rate Forecasting Using ANN & ARIMA

A comparative implementation of Artificial Neural Networks (ANN) and Autoregressive Integrated Moving Average (ARIMA) for predicting EUR/USD hourly exchange rate trends. This project aligns with the research paper "A Comparative Analysis of Machine Learning Algorithms for USD/EUR Foreign Exchange Rate Forecasting" authored by Mubaraq Onipede and team at the National Center for Artificial Intelligence and Robotics, Nigeria.


๐Ÿง  Project Overview

The foreign exchange (Forex) market is notoriously volatile and non-linear. This project investigates two powerful approaches for trend forecasting:

  • ARIMA: a classical statistical model for identifying and extrapolating linear trends.
  • ANN: a deep learning model designed to capture complex, non-linear patterns in sequential financial data.

The dataset consists of hourly EUR/USD exchange rate data sourced from MetaTrader 5, covering January 2013 โ€“ September 2016.


๐Ÿ” Research Objectives

  • Forecast hourly EUR/USD trends using supervised learning.
  • Compare ANN and ARIMA based on their predictive performance.
  • Explore how technical indicators enhance financial time series forecasting.
  • Evaluate models using metrics like Precision, Recall, and Accuracy.

๐Ÿงฐ Technologies Used

Tool Purpose
Python Core language
Pandas, NumPy Data preprocessing
Scikit-learn Feature scaling, metrics
Statsmodels ARIMA modeling
TensorFlow / Keras ANN modeling
Matplotlib / Seaborn Visualizations

๐Ÿงฎ Model Summary

๐Ÿ“Š ARIMA

  • Purpose: Linear trend modeling
  • Configuration: ARIMA(1,1,1)
  • Stationarity: Verified using Augmented Dickey-Fuller (ADF) Test
  • Limitations: Failed to capture rapid non-linear trend reversals

๐Ÿค– ANN

  • Architecture: Multi-layer Perceptron with 9 dense hidden layers
  • Activation: ReLU in hidden layers, Sigmoid in output
  • Optimizer: Adam
  • Regularization: Early stopping to prevent overfitting
  • Feature Engineering:
    • RSI
    • Bollinger Bands (Upper, Middle, Lower)
    • Moving Averages (9 & 21)
    • ATR (Average True Range)
    • Custom "Trend" label

๐Ÿ“ˆ Evaluation Metrics

Model Precision Recall Accuracy Remarks
ARIMA Moderate Low for reversals ~50% Good with linearity
ANN Balanced (0.54 avg) High on majority class 51โ€“53% Better on turning points

๐Ÿ“Œ Key Insights

  • ANN is better suited for capturing non-linear, volatile price movements.
  • ARIMA provides reliable forecasting in stationary linear trends.
  • A hybrid model leveraging both approaches could improve real-world performance.

โš ๏ธ Disclaimer:

This analysis was limited by computational constraints, allowing only 8 features to be used out of a potential 122 that could be derived through domain knowledge and advanced feature engineering. As such, the model lacks the complexity and generalization required for real-world deployment. This study is strictly for educational purposes and should not be used for commercial decisions. Users bear full responsibility for any actions taken based on this analysis.

๐Ÿ“š Reference

Onipede, M., Abiamamela, O., & Olorunsola, J. (2024). A Comparative Analysis of Machine Learning Algorithms for USD/EUR Foreign Exchange Rate Forecasting, IRE Journals, Vol 8, Issue 6.
๐Ÿ“„ Read the Full Paper

Datasets

For evaluation and improvement, datasets can be provided upon request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors