Guide · Agent skill
How to use the ML Predictive Trading Strategy agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The ml-strategy skill is a packaged set of instructions and a sample Python pipeline that lets an AI agent design a machine-learning trading strategy from price and volume history (OHLCV data). It is part of the HKUDS/Vibe-Trading project and is released under the MIT licence. This guide explains what the skill does, how to install it, how to ask for it in plain language, and where its limits are, so you can use it to prototype ideas on historical data.
Quick start
- 1Download the ZIP. Get the ml-strategy ZIP from the directory page and unzip it.
- 2Place the skill folder. Move the unzipped folder into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project.
- 3Or upload it in the apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the skill.
- 4Prepare Python and data. Install Python with pandas, numpy and scikit-learn, and prepare OHLCV data with open, high, low, close and volume columns.
- 5Describe your task. Ask the agent in plain language, naming your data, the model type and the prediction horizon.
- 6Review the output. Check that signals are between -1 and 1, then test them on periods the model did not train on.
What does the ml-strategy skill make the agent do?
An agent skill is a folder of instructions (the main file is SKILL.md) that an AI agent reads when a task matches the skill's description. This one covers machine-learning predictive strategies. Once it is loaded, the agent can build features from raw price and volume data, train scikit-learn classifiers on past data only, and turn their predictions into signals between -1 and 1.
The skill's stated purpose is to use models (RandomForest, GradientBoosting or Ridge) to predict the direction of future returns. The file says walk-forward training is used to avoid future data leakage, meaning the model never sees data from after the point it is predicting.
- Validates input: required OHLCV columns, a minimum row count, and the share of missing close prices.
- Builds features such as momentum, volatility, RSI, moving-average ratios, volume ratio, Bollinger Band position and skew.
- Labels each day by whether the future N-day return is positive (1) or negative (0).
- Retrains on an expanding or sliding window and rolls forward day by day.
- Outputs signals clipped to [-1, 1] with no NaN values.
How do you install the ml-strategy skill?
Download the ZIP for the skill from the directory page and unzip it. You can install it in one of two places. For a personal setup, put the unzipped skill folder in ~/.claude/skills/. For a single project, put it in that project's .claude/skills/ folder.
If you use the Claude apps instead of a folder on disk, open Settings, go to Capabilities, then Skills, and upload the skill there.
- Personal install: ~/.claude/skills/ (applies across your projects).
- Project install: .claude/skills/ inside the project folder.
- Claude apps: Settings → Capabilities → Skills, then upload the skill.
What do you need before the skill will run?
The skill's scripts are Python and depend on several libraries. The source lists Python, pandas, numpy and scikit-learn, plus OHLCV price data that you supply yourself. The skill does not include market data. Without Python and these libraries set up, the code will not run.
The skill runs scripts and does not use the network, according to the listing. Make sure your OHLCV data has open, high, low, close and volume columns with a DatetimeIndex, because the validation function checks for these.
- Python with pandas, numpy and scikit-learn installed.
- Your own OHLCV history with open, high, low, close and volume columns.
- At least 300 rows by default (the validate_data function's min_rows setting).
How do you ask the agent to use the skill?
Describe the task in plain terms and name the data and the kind of model you want. The skill is matched to the task, so you do not need to name the file. Good requests state the data source, the model type and the goal. For example:
"Using my daily OHLCV CSV, build a walk-forward RandomForest strategy that predicts the 5-day return direction and outputs signals between -1 and 1."
"Adapt the ml-strategy pipeline to a sliding 504-day window with gradient boosting, and check the feature sanitisation before training."
- Name the model: random_forest, gradient_boosting or ridge.
- Choose the window: expanding (all history) or sliding (fixed lookback).
- Set the prediction horizon in bars, which controls how far ahead the label looks.
def walk_forward_predict(features, labels, min_train_size=252, retrain_freq=20, model_type="random_forest", window_type="expanding", sliding_size=504, prediction_horizon=5)What are the safety limits and tips?
The skill is built for backtest-style signal generation on historical data. It is not a live trading system. The listing states that predictions from historical patterns are unreliable and can lose money. Treat any output as a research result to test, not an instruction to trade.
The code has built-in guards. Features are sanitised so infinite values become NaN, RSI and Bollinger calculations avoid division by zero, and the model is only fitted on training rows before each prediction. The source also notes that the 'ridge' option builds a LogisticRegression with an L2 penalty, so it is a classifier rather than a regression model.
- Do not connect the output to live orders with real money based on this skill alone.
- Check the number of training rows and classes: retraining is skipped if there are fewer than 50 rows or only one class.
- Keep your data clean. A close column with more than 20% missing values fails validation by default.
- Review the code the agent produces before running it on data you care about.
How should you check the results?
Because walk-forward training only uses past data at each step, your evaluation should follow the same rule. Compare the signals with the realised returns that came after each prediction, and be wary of strategies that look strong only in one market period. The skill does not include benchmarks, so any performance claim has to come from your own tests on your own data.
- Confirm the signals stay within [-1, 1] and contain no NaN values.
- Test across more than one time period.
- Record the settings (model, window, horizon) so you can reproduce each run.
What people use it for
- Prototyping whether momentum, RSI and volume features have any predictive value on a single stock's daily history.
- Creating a walk-forward backtest template with scikit-learn for a course or internal study.
- Comparing RandomForest, GradientBoosting and logistic-based ridge models under the same features.
- Learning how feature engineering and time-series validation avoid look-ahead bias.
Frequently asked questions
How do I install the ml-strategy agent skill?
Download the ZIP from the directory page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps, you can instead upload it under Settings → Capabilities → Skills.
What do I need to run the ml-strategy skill?
You need Python with pandas, numpy and scikit-learn, plus your own OHLCV price data. The skill runs scripts and does not use the network. Without the Python setup, the code will not run.
Is the ml-strategy skill free to use?
The project is released under the MIT licence, as listed on this page. Check the repository's licence file for the full terms before you reuse the code.
Can I use ml-strategy for live trading?
The listing says no for real money. The file describes backtest-style signal generation only, and predictions from historical patterns are unreliable and can lose money.
Why does the walk-forward model skip some retrains?
The code skips a retrain when there are fewer than 50 training rows or only one class in the labels. The previous model keeps making predictions, and before the first model there are none.
How does ml-strategy compare with other trading ML templates?
The source does not include benchmarks, so it makes no performance comparison. Its distinct features are the built-in walk-forward training, input validation and sanitisation of features, and the choice of three scikit-learn model types.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits quantitative researchers, developers and students who want a clear walk-forward template for building ML signals from OHLCV data and who are comfortable with Python. It is not suited to live trading or to anyone who lacks the Python and scikit-learn setup, and its outputs should be tested rigorously before any decision relies on them.
Download the skill