Machine Learning Stock Selection Model
Paste the following prompt into your AI chat to install this skill:
Please install @user_053d27d0/ml-alpha-zx according to https://skillhub.cn/install/skillhub.md.
About this skill
Problem Addressed
In A-share multi-factor stock selection, factor construction, model training, backtesting, and reporting are often scattered across separate scripts. ML-Alpha connects real akshare price and fundamental data, 20 factor features, rolling training, quintile backtesting, and HTML reporting into one reproducible workflow for studying 1/5/10/20-day forward return predictions, not direct trading signals.
How It Works and Limits
- Data layer: Fetches forward-adjusted daily prices, index constituents, and indicators such as
PE,PB, andROE; builds adate x stock x featurespanel; applies outlier clipping, cross-sectional standardization, and suspension imputation. - Feature layer: Covers technical, volume-price, fundamental, momentum, and volatility factors, including moving-average ratios, RSI, volume ratio, turnover changes, PE percentile, 1/3/6-month momentum, and 20-day volatility.
- Model layer: Supports
XGBoost,LightGBM, andRidge; trains on the past N months and predicts the next period, usingTimeSeriesSplitto reduce leakage. - Backtesting layer: Sorts stocks by predicted score, long the top group, short the bottom group, rebalances monthly, and calculates portfolio return and turnover.
- Evaluation and reporting: Outputs
IC, rolling IC, group monotonicity, Sharpe ratio, max drawdown, feature importance, and self-contained HTML with equity curves, heatmaps, and scatter plots.
Limits: A-share only, no HK or US stocks; backtests exclude commissions, slippage, and market impact; financial data may lag; models can fail in crises or policy shocks. It is intended for quantitative research and academic analysis, not investment advice.
Use Cases
- Research A-share multi-factor models by pulling akshare prices and fundamentals, training models, and testing 5-day return forecasts.
- Compare XGBoost, LightGBM, and Ridge in quintile backtests using IC, monotonicity, Sharpe ratio, and max drawdown.
- Prepare factor reports with rolling IC, feature importance, group heatmaps, and self-contained HTML output.
- Run CSI 300 or CSI 500 experiments by selecting index constituents, setting rolling windows and horizons, and rebalancing monthly.
Best For
- A-share quant analyst: wants to test whether volume, momentum, and fundamental factors predict next-period returns.
- Graduate researcher: needs a reproducible pipeline for data cleaning, rolling training, IC evaluation, and report charts.
- Strategy backtest engineer: wants to compare XGBoost, LightGBM, and Ridge across long-short group returns, drawdown, and turnover.
- Financial data engineer: wants to build panel data from real akshare feeds and export HTML diagnostics.
Related Skills
Reviews Chinese-law contract text via the accurLex API, returns the full review opinion, and exports a Word document.
Generates executable FAERS active-comparator safety comparison research plans focused on one SOC or PT family.
A reference framework for financial data analysis covering statements, KPIs, visualization, and reporting templates, without executing code or collecting data.
A knowledge-base-driven advisor for weak-current, network, and telecom equipment selection, covering parameter comparison, model recommendations, compatibility checks, and budgeting.