Home / Historical Data / ML-Ready Datasets
ML-Ready Data

ML-Ready Forex Datasets — Triple-Barrier Labels, Next-Bar Direction & Time Splits

Clean OHLC, precomputed features, triple-barrier labels, next-bar direction, time-based train/validation/test splits and a feature dictionary. Built for pandas, Polars, DuckDB, scikit-learn, XGBoost and PyTorch.

4ML-ready datasets
322,514total labeled rows
1.5× ATRupper and lower barriers
12 barstime barrier / horizon

Available ML-Ready Datasets

Each file includes features, labels and a split column. Downloads are email-gated. Parquet is recommended for Python training.

DatasetTimeframeRowsHorizonBarrierCSVParquet
XAUUSD M15 225,052 12 bars 1.5× ATR CSV Parquet
XAUUSD H1 57,055 12 bars 1.5× ATR CSV Parquet
BTCUSDT M15 13,333 12 bars 1.5× ATR CSV Parquet
EURUSD M15 27,074 12 bars 1.5× ATR CSV Parquet

Label Definitions

+1 Upper barrier

Price hits entry + 1.5× ATR(14) before the lower barrier or time barrier.

-1 Lower barrier

Price hits entry − 1.5× ATR(14) before the upper barrier or time barrier.

0 Time barrier

Neither price barrier is hit within 12 bars; the label is neutral.

Split: first 70% train, next 15% validation, final 15% test. The split is chronological, not random, so it respects time order.

Feature Dictionary & Leakage Rules

The feature dictionary lists every column, its type, a description and whether it is a feature, label or metadata. All feature columns are causal. Labels use future bars by design. Descriptive pivot columns were removed from the ML files to prevent accidental leakage.

GroupColumns
PriceTimestamp, Open, High, Low, Close, TickVolume, Spread
Returnsreturn_1, log_return_1, body, range, upper_wick, lower_wick
Trendema_9, ema_13, ema_34, ema_50, ema_200
Oscillatorsrsi_14, stoch_k_3_2_1, stoch_d_3_2_1, macd_6_13_4, macd_signal_6_13_4, macd_hist_6_13_4
Volatilityatr_14, bb_mid_20, bb_upper_20_2, bb_lower_20_2, bb_width, volatility_regime
Trend strengthadx_14, di_plus_14, di_minus_14
Contextvwap_session, session, hour, day_of_week, high_10_break, low_10_break
Labelstb_label, tb_bars, tb_return, next_bar_direction, next_bar_return
Splittrain, validation, test

Minimal Python Example

import pandas as pd

df = pd.read_parquet("XAUUSD_M15_ml_ready.parquet")
features = [c for c in df.columns if c not in {
    "Timestamp", "tb_label", "tb_bars", "tb_return",
    "next_bar_direction", "next_bar_return", "split"
}]
train = df[df.split == "train"]
valid = df[df.split == "validation"]
test  = df[df.split == "test"]

X_train, y_train = train[features], train["tb_label"]
X_valid, y_valid = valid[features], valid["tb_label"]
X_test,  y_test  = test[features],  test["tb_label"]

Encode session and volatility_regime before fitting. Drop warm-up rows with empty indicators. Do not shuffle time-series rows before splitting.

ML-Ready Dataset FAQ

What is triple-barrier labeling?

Triple-barrier labeling sets an upper barrier, a lower barrier and a time barrier. The label is +1 if the upper barrier is hit first, -1 if the lower barrier is hit first, and 0 if the time barrier is reached first.

How are the barriers calculated?

The upper and lower barriers are 1.5 times the 14-bar ATR from the entry close. The time barrier is 12 bars.

How are train, validation and test split?

The split is time-based: the first 70% of rows are train, the next 15% are validation and the final 15% are test. No random shuffling is used.

Does the dataset contain lookahead leakage?

The feature columns are causal. The labels use future bars by design. Pivot high and pivot low columns were removed to avoid accidental feature leakage.

Related Data & Tools

🚀 Invite friends — Earn $5 You both get $5 credit on Go Ad · opencode.ai AI-Powered Coding Agent — Try Free Build apps, fix bugs & ship faster with opencode. Get $5 free credit when you join. × Ad · quo.com QuoPhone — $20 Visa Gift Card Free Sign up to Quo, subscribe 3 months, get a $20 Visa gift card. Atif's referral gift for you. ×