Python · ForeignExchangeData on GitHub

What it is

A public domain dataset of EUR/USD price bars, 2-minute intervals, covering all of 2025. Alongside the data there are two small scripts: one to load and resample the bars, one to plot them. This is not a trading system. It exists so anyone can try out backtests, indicators, or analysis on real-shaped FX data without setting up a broker feed first.

This is a sandbox repository. The data comes with no guarantee of accuracy or completeness and should not be used for real trading decisions. The data and code are released under CC0, so they can be used, copied, modified, and shared for any purpose.

The data

One CSV file per month, data/eurusd_2m_2025-MM.csv, twelve files in total. Each row is a 2-minute bar.

  • datetime — bar timestamp, UTC
  • open — opening price
  • high — high price
  • low — low price
  • close — closing price
  • volume — traded volume
  • trade_count — number of trades in the bar

Loading and resampling

scripts/data_tools.py has four functions. load_month reads one month's CSV into a DataFrame, indexed by datetime and sorted. load_months loads several months and combines them into one sorted DataFrame, dropping any duplicate timestamps at the seams. load_all is load_months over every file found in data/. resample takes a DataFrame and a pandas offset alias, like "1h" or "1D", and aggregates it to that bar size: first open, max high, min low, last close, summed volume and trade count.

from scripts.data_tools import load_months, load_all, resample

df = load_months(["2025-01", "2025-02"])  # combine specific months
df = load_all()                           # combine all available months
hourly = resample(df, "1h")               # resample to any pandas offset alias

available_months() lists which months have a CSV file present, by reading the data/ folder. The other loading functions use it internally, and it is also how the plotting script fills in --all.

Plotting

scripts/visualize.py is a small command-line script. It loads one or more months, resamples them, and draws two stacked charts: closing price with the high/low range shaded behind it, and volume as a bar chart below, colored green or red depending on whether the bar closed up or down.

pip install -r requirements.txt
python scripts/visualize.py 2025-01
python scripts/visualize.py --all
python scripts/visualize.py --all --resample 1h

The --resample flag defaults to 1h. Pass any pandas offset alias, such as 5min or 1D, to change the bar size before plotting. Plotting the full year at the native 2-minute resolution is slow and cramped, so resampling first is worth doing for anything wider than a couple of months.

Project structure

data/
    eurusd_2m_2025-01.csv   # one file per month
    ...
    eurusd_2m_2025-12.csv

scripts/
    data_tools.py           # load_month, load_months, load_all, resample
    visualize.py             # command-line plotting script

CITATION.cff                # how to cite this dataset
LICENSE                      # CC0 1.0

Citing this data in a paper or write-up? See CITATION.cff in the repository.