AI Agent Hub
Back to skills
⚖️

Event-Driven Backtest Engine

Professional Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_053d27d0/backtest-engine.

About this skill

Problem It Solves

Event-driven backtesting is not just about comparing strategy equity curves; it is about checking whether a strategy can execute through a realistic trade pipeline. Daily return-only tests can miss order creation, fill confirmation, cash usage, trading halts, T+1 settlement, and transaction costs, which may overstate tradability. This skill targets A-share daily historical backtesting and separates market data, signals, orders, and fills into an inspectable event flow, useful for studying event-driven architecture, cost modeling, and strategy review.

How It Works

  • Event chain: MarketEvent → SignalEvent → OrderEvent → FillEvent, with an event queue advancing backtest state.
  • Data and strategies: uses akshare for forward-adjusted daily bars and includes ma_cross, rsi, and bollinger.
  • Trading rules: models A-share T+1, 100-share lots, commission, stamp duty, transfer fee, and slippage.
  • Analytics and attribution: reports Sharpe, Sortino, Calmar, max drawdown, win rate, payoff ratio, and Brinson allocation, selection, and interaction effects.
  • Output: generates an HTML report with an equity curve, drawdown curve, monthly return heatmap, and trade log.

Boundaries

It is suitable for daily-bar historical validation, cost-sensitive A-share backtests, and learning event-driven backtest design. It does not support live trading, minute or tick-level backtests, short selling, price-limit constraints, or order-book depth simulation; fills are based on daily close prices, and results are for research only.

Use Cases

  • Review A-share daily strategies by tracing whether signal-to-fill execution is affected by T+1 and costs
  • Compare MA cross, RSI, and Bollinger strategies over the same ticker window using equity and max drawdown
  • Generate a single-file HTML report to show equity curve, drawdown, and monthly return heatmap
  • Run Brinson attribution to inspect allocation, selection, and interaction contributions to excess return

Best For

  • Quantitative strategy researchers who need to validate daily-bar signals under A-share cost rules
  • Event-driven architecture learners who want to trace the MarketEvent to FillEvent backtest state flow
  • A-share data analysts who need HTML reports with performance metrics and monthly return heatmaps
  • Performance attribution analysts who need to decompose allocation, selection, and interaction effects