Event-Driven Backtest Engine
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
aksharefor forward-adjusted daily bars and includesma_cross,rsi, andbollinger. - 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
Related Skills
Based on Hengsheng Juyuan MCP financial data, it assesses equity, bond, commodity, and overseas markets and produces sourced risk reports with allocation guidance.
Applies a six-question industry-chain framework for structured fundamental analysis of sectors, profit pools, competition, ROIC, valuation, and domestic substitution.
Performs structured contract risk assessment, adds revision suggestions in the document, and generates a standalone review report.
A single-stock research framework that produces seven-dimension drafts, integrated analysis, scenario projections, and dual-track reference, with optional comparison and no investment advice.