---
license: mit
pipeline_tag: time-series-forecasting
library_name: safetensors
tags:
- finance
- financial-markets
- time-series
- stock-market
- forecasting
- quantitative-finance
- foundation-model
- kronos
- idx
- bei
- nasdaq
- tse
- nse
- indonesia
- japan
- india
- united-states
- safetensors
- andrei-ramani
- a-ramani
- fkm-unej
- universitas-jember
- unej
datasets:
- custom
metrics:
- mape
- accuracy
---
Kronos-FT: Quantitative Foundation Models for Financial Markets
---
## Model Overview
**Kronos-FT** is a suite of exchange-specific quantitative foundation models built upon and fine-tuned from Kronos (Shi et al., *A Foundation Model for the Language of Financial Markets*, Tsinghua University, AAAI 2026), enabling market-specific quantitative analytics and forecasting.
While general time-series foundation models often struggle with domain-specific market microstructures, order flow dynamics, and regional volatility clustering, Kronos-FT adapts the underlying 102.3M-parameter decoder-only autoregressive architecture directly to individual equity exchanges.
This repository hosts official production-validated model checkpoints and pre-calibrated tokenizers serialized in native high-performance [SafeTensors](https://github.com/huggingface/safetensors) format.
---
## Exchange Coverage & Status
| Exchange | Region | Status | Context Window | Primary Horizon |
| :--- | :--- | :---: | :---: | :---: |
| **IDX** (Indonesia Stock Exchange) | 🇮🇩 Indonesia | **Ready** | 256 bars | 5-bar Swing / 16-bar Intraday |
| **NASDAQ** | 🇺🇸 United States | **Ready** | 256 bars | Swing / Intraday |
| **TSE** (Tokyo Stock Exchange) | 🇯🇵 Japan | **Ready** | 256 bars | Swing / Intraday |
| **NSE** (National Stock Exchange) | 🇮🇳 India | **Ready** | 256 bars | Swing / Intraday |
---
## Key Architecture & Capabilities
- **Timeframe-Agnostic Reasoning:** Unified multi-resolution modeling supporting 8 granularities simultaneously: `1T` (1-min), `3T` (3-min), `5T` (5-min), `15T` (15-min), `30T` (30-min), `1H` (1-hour), `D` (Daily), and `W` (Weekly).
- **Zero-Lookahead Temporal Integrity:** Strict chronological dataset partitioning with temporal gap buffers to eliminate future lookahead data leakage.
- **Continuous-to-Discrete Quantized Tokenization:** Specialized tokenizer maps multi-dimensional candlestick vectors (Open, High, Low, Close, Volume, and Amount) into discrete tokens while preserving non-linear volatility distributions.
- **Autoregressive Price Trajectory Generation:** Generates multi-step predictive trajectories with controllable temperature ($T$), top-$k$, and top-$p$ sampling to model market uncertainty.
- **Fast, Memory-Mapped Loading:** Fully exported to SafeTensors for instantaneous weight loading and reduced RAM footprint during inference.
---
## NASDAQ Performance Benchmarks (vs Base Model)
Out-of-sample evaluation on 10 institutional benchmark tickers across the NASDAQ-100 (with 40 test scenarios):
| Metric | Base Model (Kronos-Base) | **Kronos-FT (NASDAQ)** | Improvement |
| :--- | :---: | :---: | :---: |
| **Daily Directional Accuracy** | 30.0% | **60.0%** | **+100% Relative Improvement (2x Base)** |
| **1-Hour Directional Accuracy** | 80.0% | **70.0%** | High-precision intraday timing |
| **Daily Information Coefficient (IC)** | -0.002 | **+0.083** | Robust positive waveform correlation |
| **Daily Average MAPE** | 6.54% | **4.91%** | **-24.9% price error reduction** |
| **1-Hour Average MAPE** | 1.79% | **1.73%** | Lower error on intraday hourly bars |
| **Overall Return MAE** | 2.92% | **2.50%** | **-14.4% return error reduction** |
---
## NSE Performance Benchmarks (vs Base Model)
Out-of-sample evaluation across 10 benchmark constituent equities representing core Nifty 50 sectors across 5 operational timeframes (750 total independent rolling evaluation windows):
| Metric | Base Model (Kronos-Base) | **Kronos-FT (NSE)** | Improvement |
| :--- | :---: | :---: | :---: |
| **Daily Directional Accuracy** | 53.33% | **54.67%** | **+1.33 pp** edge on daily swing direction |
| **30-Min Directional Accuracy** | 44.00% | **50.00%** | **+6.00 pp** intraday directional lift |
| **Daily Return MAE** | 3.337% | **3.038%** | **-8.96% relative error reduction** |
| **Weekly Return MAE** | 10.953% | **5.848%** | **-46.60% relative error reduction** |
| **30-Min Return MAE** | 43.177% | **38.457%** | **-10.93% relative error reduction** |
| **1-Hour Return MAE** | 35.344% | **30.485%** | **-13.75% relative error reduction** |
| **Cross-Market Generalization (QQQ Daily)** | 2.64% MAPE | **1.91% MAPE** | Zero catastrophic forgetting (+27.8% gain) |
| **Overall Regime Win Rate** | — | **4 Wins, 1 Tie, 0 Losses** | Robust across 750 rolling windows |
---
## TSE Performance Benchmarks (vs Base Model)
Out-of-sample evaluation on 180 multi-window test scenarios across 10 institutional Nikkei 225 benchmark tickers (Autos, Megabanks, Semis, Sogo Shosha, Electronics, and Nikkei 225 ETF across 6 timeframes):
| Metric | Base Model (Kronos-Base) | **Kronos-FT (TSE)** | Improvement |
| :--- | :---: | :---: | :---: |
| **Overall Price MAPE** | 5.972% | **2.894%** | **-51.5% relative error reduction** |
| **Overall Return MAE** | 7.766% | **3.803%** | **-51.0% relative error reduction** |
| **Weekly Return MAE** | 28.766% | **7.157%** | **-75.1% relative error reduction** |
| **Daily Return MAE** | 7.189% | **5.197%** | **-27.7% relative error reduction** |
| **15-Min Directional Accuracy** | 36.7% | **53.3%** | **+16.6 pp** higher intraday hit rate |
| **Daily Directional Accuracy** | 33.3% | **43.3%** | **+10.0 pp** higher directional precision |
| **Nikkei 225 ETF (1321.T) Return MAE** | 6.008% | **2.160%** | **-64.0% benchmark error cut (14/18 wins)** |
| **Scenario Wins Count (Return MAE)** | 68 Wins | **111 Wins (1 Tie)** | **62.0% clear win rate across market regimes** |
---
## IDX Performance Benchmarks (vs Base Model)
Out-of-sample evaluation on 10 benchmark constituent equities across Indonesia Stock Exchange (IDX) sectors (40 comprehensive evaluation scenarios):
| Metric | Base Model (Kronos-Base) | **Kronos-FT (IDX)** | Improvement |
| :--- | :---: | :---: | :---: |
| **Daily Directional Accuracy** | 50.0% | **80.0%** | **+30.0%** (8 of 10 sectors 100% correct) |
| **Daily Average MAPE** | 7.28% | **3.70%** | **-49.2% relative error** |
| **Overall 40-Scenario MAPE** | 3.12% | **2.22%** | **-28.8% relative error** |
| **Validation Cross-Entropy Loss** | 2.5800 | **2.4792** | Lower perplexity on market tokens |
---
## Quickstart & Inference
### 1. Installation
Ensure you have Python 3.10+ and PyTorch installed with CUDA support:
```bash
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
pip install safetensors einops pandas numpy pyyaml tqdm huggingface_hub
```
Clone the companion codebase repository for inference utilities:
```bash
git clone https://github.com/andreiramani/kronos-ft.git
cd kronos-ft
```
### 2. Loading Weights Directly from Hugging Face Hub
You can load the fine-tuned model and tokenizer directly using the built-in factory loader (example below for IDX market):
```python
import pandas as pd
from model import KronosPredictor
# 1. Initialize predictor engine directly from Hugging Face Hub
predictor = KronosPredictor.from_pretrained(
"andreiramani/kronos-ft",
exchange="idx",
device="cuda:0"
)
# 2. Prepare 256 bars of historical OHLCV data
# Expected columns: ['open', 'high', 'low', 'close', 'volume', 'amount']
df = pd.read_csv("data/idx/D/BBRI_D.csv")
df["timestamps"] = pd.to_datetime(df["timestamps"])
x_df = df.iloc[-256:][["open", "high", "low", "close", "volume", "amount"]].reset_index(drop=True)
x_ts = df["timestamps"].iloc[-256:].reset_index(drop=True)
# Generate forecast timestamps for the next 5 business days
y_ts = pd.date_range(
start=x_ts.iloc[-1] + pd.Timedelta(days=1),
periods=5,
freq="B"
).to_series().reset_index(drop=True)
# 3. Generate 5-day ahead swing trajectory forecast
forecast_df = predictor.predict(
df=x_df,
x_timestamp=x_ts,
y_timestamp=y_ts,
pred_len=5,
T=0.3, # Sampling temperature (lower = more deterministic)
sample_count=5, # Monte-Carlo trajectory ensemble count
top_p=0.9, # Nucleus sampling threshold
verbose=False
)
print("Predicted Next 5-Bar Trajectory:")
print(forecast_df[["open", "high", "low", "close"]])
```
### 3. Alternative: Manual Download via `huggingface_hub`
```python
from huggingface_hub import hf_hub_download
from model import KronosTokenizer, Kronos, KronosPredictor
# Download individual SafeTensors checkpoints
model_path = hf_hub_download(
repo_id="andreiramani/kronos-ft",
filename="idx_model.safetensors",
subfolder="idx"
)
tokenizer_path = hf_hub_download(
repo_id="andreiramani/kronos-ft",
filename="idx_tokenizer.safetensors",
subfolder="idx"
)
# Load into PyTorch
tokenizer = KronosTokenizer.from_pretrained(tokenizer_path)
model = Kronos.from_pretrained(model_path)
predictor = KronosPredictor(model=model, tokenizer=tokenizer, device="cuda:0")
```
---
## Training Data Scale
Kronos-FT fine-tuning utilizes an aggregate dataset of **48,294,489 K-line candlestick bars** across multi-resolution timeframes:
- 🇮🇩 **IDX (Indonesia):** 9.65M bars across 50 liquid equities (10+ years historical depth).
- 🇺🇸 **NASDAQ (US):** 10.45M bars across 30 large-cap technology stocks (25+ years daily depth since 2000).
- 🇯🇵 **TSE (Japan):** 6.68M bars across 30 Nikkei 225 constituent equities.
- 🇮🇳 **NSE (India):** 21.49M bars across 30 Nifty 50 constituents (7.5+ years of verified intraday history).
---
## ⚠️ Disclaimer
> [!WARNING]
> **NOT FINANCIAL OR INVESTMENT ADVICE:**
> All model outputs, price trajectories, candlestick forecasts, quantitative metrics, and evaluations produced by **Kronos-FT** are provided strictly for academic research, artificial intelligence experimentation, and financial time-series modeling studies.
>
> **None of the data, projections, or insights generated constitute formal financial advice, investment recommendations, endorsements, or legal solicitation to buy or sell securities.**
>
> Trading financial instruments across equities markets (including IDX, NASDAQ, TSE, and NSE) involves substantial volatility and high risk of capital loss. Historical backtesting and past performance do not guarantee future results or profitability.
>
> Users bear sole and full responsibility for all trading decisions, independent analysis (*Do Your Own Research* / DYOR), and risk management execution. The developers and contributors assume no liability whatsoever for any direct or indirect financial losses, damages, or costs incurred as a result of using this software or these models.
---
## 📜 Citation & Attribution
If you use Kronos-FT or the underlying Kronos foundation model in your research, please cite:
```bibtex
@article{shi2025kronos,
title = {Kronos: A Foundation Model for the Language of Financial Markets},
author = {Shi, et al.},
journal = {AAAI Conference on Human Computation and Crowdsourcing (AAAI 2026)},
year = {2026},
url = {https://arxiv.org/abs/2508.02739}
}
@misc{ramani2026kronosft,
title = {Kronos-FT: Quantitative Foundation Models for Financial Markets},
author = {Ramani, Andrei},
year = {2026},
howpublished = {\url{https://huggingface.co/andreiramani/kronos-ft}}
}
```
---
## 👤 Developer & Maintainer
- **Lead / Fine-Tuning Engineer:** [Andrei Ramani](https://www.linkedin.com/in/andreiramani/)
- **Repository:** [github.com/andreiramani/kronos-ft](https://github.com/andreiramani/kronos-ft)
- **Model Registry:** [huggingface.co/andreiramani/kronos-ft](https://huggingface.co/andreiramani/kronos-ft)