Individual skill
ml-strategy
Machine-learning predictive strategy based on sklearn walk-forward training, feature engineering, and signal generation. Suitable for any OHLCV data.
agent/src/skills/ml-strategy/SKILL.md
Source commit a79afbdb048f873433fdb651a667e43dd0bb735d
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 9, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 38,000
- Repository last updated
- Nov 9, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- backtesting Repository topic
- multi-agent Repository topic
- quantitative-finance Repository topic
- trading Repository topic
- ai-agent Repository topic
- algorithmic-trading Repository topic
- fintech Repository topic
- llm Repository topic
- mcp Repository topic
- python Repository topic
- engineering Derived category
- data Derived category
- education Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Read excerpt
# Machine-Learning Predictive Strategy
## Purpose
Use sklearn machine-learning models (`RandomForest` / `GradientBoosting` / `Ridge`) to predict the direction of future returns and generate trading signals. Walk-forward training is used to avoid future data leakage, and feature engineering extracts useful factors from OHLCV data.
## Signal Logic
1. **Validate input**: check OHLCV columns, minimum row count, NaN ratio — skip symbols that fail
2. **Feature engineering**: build multi-dimensional factors from raw OHLCV data (momentum, volatility, RSI, moving-average ratios, volume ratio, and more). All features are sanitized (inf removed, division-by-zero guarded)
3. **Label construction**: future N-day return > 0 is the positive class (`1`), < 0 is the negative class (`0`)
4. **Walk-forward training**: use an expanding or sliding window, train on historical data only, and roll forward day by day for prediction
5. **Signal generation**: map `predict_proba[:, 1]` to `[-1.0, 1.0]`, or use discrete signals from `predict` in `{-1, 0, 1}`. Output is guaranteed clean (no NaN, clipped to range)
## Complete SignalEngine Example