|
Download README.md from ai-arie/classic-patterns-models: direct link, hf CLI and curl.
- Browser
- Download file 5.41 kB
-
https://huggingface.co/ai-arie/classic-patterns-models/resolve/main/README.md
- Command line
-
hf download hf://ai-arie/classic-patterns-models/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/ai-arie/classic-patterns-models/resolve/main/README.md
5.41 kB
| license: apache-2.0 | |
| base_model: autogluon/chronos-2-small | |
| base_model_relation: finetune | |
| library_name: onnx | |
| tags: | |
| - time-series | |
| - finance | |
| - chart-patterns | |
| - onnx | |
| - lightgbm | |
| extra_gated_heading: "Request access to the classic-patterns screener models" | |
| extra_gated_prompt: >- | |
| These models are shared for research and education only. They are not investment or financial | |
| advice and not a signal service; there is no warranty of any kind. Requests are reviewed by hand. | |
| extra_gated_fields: | |
| Name: text | |
| Affiliation (or "independent"): text | |
| What will you use the models for?: text | |
| I will use the models for research or education only, not as investment advice or for automated trading: checkbox | |
| I understand the models come with no warranty and that I decide on my own trades: checkbox | |
| extra_gated_button_content: "Request access" | |
| # classic-patterns screener models | |
| **Shows pattern setups with estimated probabilities; you decide.** Do not take every pattern it | |
| finds — use your own judgement. This is a research / education project and **not investment or | |
| financial advice**. No warranty. | |
| Code, data download and the screener app: https://github.com/ai-arie/classic-patterns | |
| **Article:** [I Trained AI on 30 Years of Stock Data to Answer One Question: Do Classic Chart Patterns Beat the Market?](https://medium.com/p/1839b255e988) (Medium): what I tested, the results, and why the answer is no. | |
| ## What the models do | |
| For a chart pattern detected on daily US stock data (cup-and-handle, deep cup, head-and-shoulders | |
| top, inverse head-and-shoulders, consolidation breakout, ascending triangle) that triggered at | |
| today's close, the models estimate how the pattern's own trade plan would play out: entry at the | |
| next open, the pattern's stop and target, at most 60 trading days. Output: P(target first), | |
| P(stop first), P(neither within 60 days) and an expected R (multiple of the initial risk, net of | |
| 10 bps per side, from training-period averages). | |
| | file | model | | |
| |---|---| | |
| | `student.int8.onnx` | distilled student: Chronos-2-Small (autogluon/chronos-2-small, 28M parameters) fine-tuned with custom heads, distilled from three Chronos-2 teachers; ONNX int8, CPU, ~78 ms per stock | | |
| | `student.onnx` | the same student, fp32 | | |
| | `lgbm.txt` | LightGBM on hand-crafted pattern, stock and market features | | |
| Both are calibrated (temperature scaling) on the last ~2 years of training data. Also included: | |
| `student.json` / `lgbm.json` (inputs, calibration, settings), `configs/` (the detector, feature | |
| and label settings the models were trained with), `manifest.json` (code and data hashes), | |
| `parity.parquet` (reference scores to check your installation) and `checksums.sha256`. | |
| The screener app built on these models shows long setups only: short setups are in the training data | |
| but are not shown because their results in testing were not good enough. Setups that are still | |
| forming show only their chance of triggering. | |
| ## How to use | |
| 1. Install the screener from the code repository (`uv sync --extra data --extra app`) and build | |
| your data as its README describes. | |
| 2. Once your access request is approved, log in (`hf auth login`) and download this repository's | |
| files into `models/production/` of the code folder: | |
| `hf download ai-arie/classic-patterns-models --local-dir models/production`. | |
| 3. `uv run python scripts/parity_check.py` must print `PARITY OK` (your data build reproduces the | |
| reference scores), then `uv run python scripts/screen.py --refresh` and | |
| `uv run streamlit run src/classic_patterns/app/ui.py`. | |
| No PyTorch or GPU is needed. | |
| ## Training data | |
| - Daily prices of US stocks listed on 2026-10-23 (Nasdaq Trader symbol directory), | |
| from Yahoo Finance via `yfinance`; training samples from 1995-01-01, data to | |
| 2026-10-23. Training split until 2024-10-01, calibration / early stopping after. | |
| - Setups only on liquid days (close ≥ $5, 50-day dollar volume ≥ $15M, ≥ 300 days of history). | |
| - No price data are included in the weights or in `parity.parquet`, which holds 300 scored setups | |
| (ticker, date, scale-free geometry, scores) for the installation check. | |
| ## Limitations | |
| - **Survivorship bias:** only companies listed today; delisted stocks are missing. | |
| - Yahoo data quality (adjustments, gaps) is not guaranteed. | |
| - Costs are a flat 10 bps per side; short-borrow cost and availability are ignored. | |
| - Pattern definitions are one operationalisation of subjective chart patterns. | |
| - At screening time the entry price is unknown; the models use today's close in its place. | |
| - Targets are the patterns' textbook measured moves and are usually far away. Setting take-profit | |
| levels was not trained, so use your own judgement, especially with the targets. | |
| - Probabilities describe past behaviour of similar setups; markets change. | |
| - Chronos-2's pretraining data are not completely documented. | |
| ## Compute | |
| The whole project (hyperparameter search, walk-forward evaluation, holdout test, final models) | |
| used approximately 141 GPU-hours on NVIDIA A100 80GB GPUs; the final models themselves about | |
| 5 GPU-hours. The app runs on CPU. | |
| ## Intended use | |
| Research and education: screening and studying chart patterns. Not for automated trading, not a | |
| signal service, not investment advice. | |
| ## License | |
| Apache License 2.0 (see `LICENSE` and `NOTICE`). The student derives from Chronos-2-Small | |
| (Apache-2.0, Copyright Amazon.com, Inc. or its affiliates). | |