---
title: A Frequency-Domain Foreign Exchange Prediction Experiment
description: An older EUR/USD prediction experiment built from smoothing, short-time Fourier transforms, extrapolation, and a Python prediction server.
date: 2026-05-03
projectPeriod: 'Autumn 2019'
thumbnail:
  src: ./_assets/forex.jpg
  alt: Chart comparing predicted and actual EUR/USD exchange rates.
tags: ['systems', 'tools']
selected: false
project: forex
role: Experiment author
stack: ['Python', 'NumPy', 'SciPy', 'Flask', 'MQL4']
outcome: A working prediction server connected to an MQL4 client for trading experiments
audience: technical
links: []
---

This was an experiment in predicting EUR/USD rates. The animation from the old portfolio showed the implementation doing a somewhat good job predicting the rates: the prediction was the blue graph and the actual values were the green chart. Of course, I would not trust it with my money.

The algorithm was a fancy linear regression in the frequency domain. The steps were: smoothing the input values, differentiating, applying a short-time Fourier transformation with overlapped and Hanning-windowed windows, extrapolating, and then applying the inverse of these transformations to the resulting values.

The prediction server was written in Python using NumPy, SciPy, and Flask. It communicated with an MQL4 client that was responsible for handling financial transactions based on the generated data.

There was still plenty of room for improvement, but even with this simple algorithm, a sometimes profitable trading strategy was viable. More importantly, the project gave me a useful look into trading algorithms, their complexity, and the fierce competition around them.
