AI Agent Hub
Back to skills
⚖️

Machine Learning Stock Selection Model

Professional Updated 2026.08.30

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, and ROE; builds a date x stock x features panel; 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, and Ridge; trains on the past N months and predicts the next period, using TimeSeriesSplit to 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.