AI-Powered Currency Prediction

How Machine Learning is Changing Financial Forecasting

Abstract

The uncertainty in future currency fluctuations poses significant challenges for businesses, particularly in international trade, where accurate forecasting of currency exchange rates is crucial for making informed decisions. Developing a predictive model that can estimate future currency prices is essential for businesses to plan effectively. This study presents a model trained on historical currency data, incorporating engineered features to capture underlying patterns and correlations that influence exchange rate movements. The results demonstrate the model’s potential to provide valuable insights for businesses, especially in facilitating decision-making related to import and export activities. This predictive approach offers promising prospects for improving future business strategies in a volatile economic environment.

Introduction

Problem Statement

There is a significant demand for a predictive model that can forecast future currency exchange rates with minimal input, reducing the reliance on large amounts of complex or detailed data. In the real world, obtaining accurate and timely data about economic indicators, market sentiment, and geopolitical events can be challenging, especially for businesses with limited resources or access to such information. A model capable of predicting currency rates without requiring extensive data would be highly beneficial, as it could provide more accessible, real-time predictions, enabling businesses to make better decisions without the need for elaborate datasets or specialized knowledge. Developing such a model would be valuable not only for improving efficiency in decision-making but also for reducing the costs and complexities associated with gathering and analyzing large quantities of financial data.

Objectives

  • Develop a predictive model that can achieve high accuracy while requiring minimal input data.

  • Design a model capable of making reliable currency exchange rate predictions for the next 6-12 months.

  • Ensure that the model can adapt to various market conditions and account for long-term trends.

Scope

The model is built by training on data sourced from various reliable external providers. It focuses on identifying and incorporating features that are strongly correlated with currency price fluctuations. While challenges may arise, such as obtaining high-quality data and performing effective feature engineering, these will be addressed throughout the process. An important assumption in the project is that each feature included is initially assumed relevant, with irrelevant features being filtered out during the evaluation phase.

Methodology

Time Series Overview

The dataset utilized for this analysis was sourced from the Central Bank Of Kenya, spanning from October 2016 to January 2024, consisting of approximately 1,803 entries. Given the time-series nature of the data, an Augmented Dickey-Fuller (ADF) test was conducted to assess whether the series was stationary. The ADF test results indicated non-stationarity, leading to the need for transformations. The data was differenced and additional engineered features, such as Month, Day, Week of the Year, Quarter, and Day of the Week, were incorporated.

Various regression algorithms were trained on the dataset, but none performed exceptionally well initially. Ridge regression emerged as the best model, achieving an accuracy of 3.58%. Attempts to apply SARIMAX on the differenced data, as well as ARIMA and SARIMA models on the original data, also yielded poor performance.

Regression and Feature Importance

Further feature engineering was conducted to enhance the dataset, incorporating additional variables such as Day of Year, Election Year, and whether it was a U.S. election year. After training a variety of regression models—including Ridge, Lasso, RandomForest, KNeighborsRegressor, SVR, XGBRegressor, ElasticNet, GradientBoostingRegressor, AdaBoostRegressor, LGBMRegressor, and MLPRegressor—the accuracy improved to 28%, though it remained below the 50% threshold.

To improve the model’s predictive capability, data from November 2024 to January 2025 was added, along with the incorporation of U.S. Interest Rate data sourced from the Federal Reserve Bank. The U.S. Interest Rate exhibited a positive correlation with USD exchange rates over time.

Additionally, Recursive Feature Elimination (RFE) was applied to identify the most significant features influencing the target variable. The final selected features were: US Interest Rate, Day of Year, Week of Year, Month, Election Year.

After training the model with the selected features, the accuracy increased to 87%, demonstrating a significant improvement. This highlighted the importance of U.S. Interest Rates in determining currency prices.

Model Training and Prediction Results

At this stage, the models were trained using unscaled data and all available features in the dataset. This approach yielded the most accurate results, with the RandomForestRegressor achieving 96% accuracy after training. Subsequent predictions were made using test data, and comparisons with actual values confirmed the model’s reliability and effectiveness in predicting currency exchange rates.

Discussion

The selected features played a crucial role in improving the model's predictive capabilities. The best-performing models were RandomForestRegressor and LightGBMRegressor, with additional strong performances from XGBoost, GradientBoostRegressor, and AdaBoost, all exceeding 90% accuracy.

Future enhancements could include sentiment analysis as an additional feature, analyzing market sentiment and news articles to provide deeper insights and further improve prediction accuracy.

Conclusion

This project successfully addressed the challenge of predicting currency exchange rates—a critical task for businesses operating in international markets. By developing a model that forecasts future exchange rates with minimal input data, we aimed to simplify the prediction process and improve business decision-making.

Key findings include:

  • Macroeconomic indicators like U.S. Interest Rates significantly impact exchange rates.

  • Machine learning models, particularly ensemble methods, outperform traditional forecasting techniques.

  • Feature engineering and data transformation play a crucial role in model accuracy.

With additional refinements, such as incorporating real-time sentiment analysis and economic indicators, businesses could further benefit from AI-driven financial forecasting tools.

You can try making your currency predictions here .

What are your thoughts on AI-powered financial forecasting? Let us know in the comments!