PatchTST, Quantiles and Probabilistic Forecasts on Minute Candles

A forecast without an interval is not a result. Our research team trains patch transformers on one-minute candles and reports quantiles, because a single predicted price hides the only thing that matters: how wrong that price can be.
The data behind the research
Our collector writes closed 1-minute OHLCV bars into TimescaleDB. Five properties decide what a model can learn:
- closed bars only, exchange candles are stored after they are marked confirmed;
- exact decimals, prices land in
numericcolumns and never pass through floats; - idempotent writes, the primary key
(source_id, ts)makes a refetch unable to duplicate or silently rewrite history; - real gaps, no synthetic bar fills a weekend, a halt or an outage;
- recorded publication delay, 15 minutes for US stocks, none for crypto spot.
The catalogue requests five years of minute history per instrument across crypto, stocks, options, indices and futures.
Why PatchTST fits minute data
PatchTST cuts a series into patches that act as tokens and keeps channels independent, as described in the original paper. Two consequences matter here:
- a 512-minute context costs far less attention than 512 single-point tokens;
- one set of weights serves thousands of instruments without blending their scales.
In Python, PatchTSTForPrediction accepts past_values and past_observed_mask, so our real gaps stay flagged as missing instead of being quietly interpolated.
Quantiles instead of one number
We train quantile heads with pinball loss, or use the distribution head with negative log likelihood and sample 100 paths, then read quantiles from those samples. Four rules govern the output:
| Rule | Check |
|---|---|
| Ship q0.1, q0.5 and q0.9 | the median is one quantile, not the answer |
| Measure coverage | an 80% interval must contain about 80% of outcomes |
| Repair crossing quantiles | sort, then recalibrate on a recent holdout |
| Score with pinball loss and CRPS | accuracy alone hides interval width |
How a study runs
- every feature row carries the time it became public, so nothing trains on data that did not exist yet;
- walk-forward folds keep a purge and an embargo between training and test windows;
- baselines come first: last value, seasonal naive, then gradient boosting on tabular features;
- seeds, library versions and SHA256 dataset manifests are pinned, so a reported number can be rebuilt;
- experiments run on preemptible machines to keep the compute bill small.
What we do not claim
Our instrument catalogue covers active tickers, which is survivorship bias we name rather than hide. No backtest returns appear here. The research question stays narrow: can a patch transformer deliver calibrated intervals on minute data that beat a seasonal-naive baseline? Terms used above are defined in our engineering glossary.