Reverse engineering. Forecasts from a sampled model are probabilistic and should be checked against your own out-of-sample data before anyone relies on them for trading decisions.
Who it is forA quant analyst or developer with a CSV of 5-minute or daily candles who needs a quick model-based forecast for one instrument.
The problemTurning raw candlestick history into a usable forecast normally means writing your own preprocessing, normalization, and inverse scaling around a model.
The outcomeA pandas DataFrame of forecasted open, high, low, close, volume and amount values, indexed by the future timestamps you supplied.
What you need first
- Python 3.10 or newer
- pip, and access to install requirements.txt
- Internet access to load models from the Hugging Face Hub
- Historical candlestick data in a pandas DataFrame with open, high, low, close columns
- For fine-tuning only: a local Qlib data directory, a GPU setup that works with torchrun, and optionally a Comet.ml account
Steps
- Run
pip install -r requirements.txtin the cloned Kronos folder, using Python 3.10 or newer. - Load the tokenizer and model with
KronosTokenizer.from_pretrained("NeoQuasar/Kronos-Tokenizer-base")andKronos.from_pretrained("NeoQuasar/Kronos-small"). - Create the predictor with
KronosPredictor(model, tokenizer, max_context=512). - Split your data into a lookback window of 400 rows as
x_df,x_timestamp, and a 120-stepy_timestamprange, keeping the lookback at or below 512. - Call
predictwithpred_len=120,T=1.0,top_p=0.9, andsample_count=1, then printpred_df.head().
Prompt for your agent
Using the Kronos repo, load NeoQuasar/Kronos-small with its tokenizer, forecast the next 120 candles for <CSV path with open, high, low, close columns and timestamps>, and return the pred_df table. Verify that the forecast index matches the y_timestamp values you passed in and that the lookback is no more than 512 rows.
Caveat. The README gives a demo forecast for BTC/USDT and a live demo page, but it does not report accuracy or backtest results for the default models.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page