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.
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.
- 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.
| Tool | Purpose |
|---|---|
| Python | Core language |
| Pandas, NumPy | Data preprocessing |
| Scikit-learn | Feature scaling, metrics |
| Statsmodels | ARIMA modeling |
| TensorFlow / Keras | ANN modeling |
| Matplotlib / Seaborn | Visualizations |
- 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
- 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
| 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 |
- 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.
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.
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
For evaluation and improvement, datasets can be provided upon request.