---
title: Predicting EUR/USD With Hanning Windows
description: A weekend frequency-domain experiment that did a passable job on EUR/USD. I would not have trusted it with my money, and I didn't.
date: 2026-05-03
period: 'Autumn 2019'
thumbnail:
  src: ./_assets/forex.jpg
  alt: Chart comparing predicted and actual EUR/USD exchange rates.
article:
  tags: ['systems', 'tools']
  role: Experiment author
  stack: ['Python', 'NumPy', 'SciPy', 'Flask', 'MQL4']
  outcome: A prediction server, an MQL4 trading client, and a clearer view of how far my edge wasn't
  audience: technical
project:
  title: Foreign Exchange Prediction Experiment
  description: A Hanning-windowed STFT experiment on EUR/USD. Passable backtest, sober conclusions, no real money risked.
  thumbnail:
    alt: Chart from a foreign exchange prediction experiment.
---

In the autumn of 2019 I was an undergrad with a few free weekends and the quiet conviction that I could find a small edge on EUR/USD. The screenshots that survive are flattering: the predicted rate in blue hugging the actual rate in green closely enough to look like skill. It was a linear extrapolation in the frequency domain wearing a nice coat.

The pipeline: smooth the price series, differentiate it, run a short-time Fourier transform over overlapped Hanning-windowed frames, extrapolate the frequency-domain coefficients forward, then invert everything back into a predicted price. A Python server (NumPy, SciPy, Flask) served the model; an MQL4 client sitting in a broker terminal called it and stood ready to place trades, if I'd dared. I never dared, and that restraint is the part of the project that aged best.

What the weekends actually bought me was a working understanding of the trap: even a naive model will hand you a sometimes-profitable backtest, and a sometimes-profitable backtest is the most persuasive wrong evidence there is. The people playing this game for real have co-located servers, microsecond ticks, and teams whose whole job is the thing I was doing between lectures. I didn't learn how to predict currencies. I learned, precisely and cheaply, how far my edge wasn't, which I've come to think is the best possible return on a project like this.
