Repository navigation
EasyQuant eqlib 2.0.0 hardens China A-share backtesting to production grade across market rules, data honesty, and the notification pipeline. This release contains several breaking changes β each is listed below with its documented opt-out.
β οΈ Breaking Changes
- Price-limit interception on by default (
check_price_limit=True) β buy orders opening at the limit-up price and sell orders opening at the limit-down price no longer fill; price bands are board- and date-aware (main board Β±10%, ST Β±5%, ChiNext Β±20% after registration reform, STAR Β±20%, BSE Β±30%). Restore old behavior:set_option('check_price_limit', False) - Authoritative exchange trading calendar β no longer inferred from the union of universe data; missing data for one stock no longer erases a trading day
- Suspension semantics unified to same-day cancellation β orders on suspended days are cancelled with a recorded
cancel_reasoninstead of carrying over to resumption - Forced liquidation of delisted positions β positions with no quotes beyond
delist_gap_days(default 30 trading days) are liquidated at the last close; keep them withdelisted_position_handling="keep" - Win-rate and PnL metrics now fee-inclusive β consistent with the cash ledger; the old fee-free basis systematically overstated win rates
- Brinson attribution rewritten as true single-period BHB β allocation + selection + interaction now sum exactly to excess return (the old implementation did not close numerically)
alpha/beta/information_ratioreturnNaNwhen no benchmark is available β replacing silent defaults; reports renderN/A- New
AlertLevel.NORMALbaseline βdaily_check()with zero triggers returnsNORMALinstead ofYELLOW; code treating== YELLOWas "all clear" should checkNORMALinstead
Fixed
- Order-event notifications actually fire β
enable_notification(["queued", "filled"])now auto-pushes DingTalk/Feishu messages in paper/live sessions (fill price, amount, commission, partial-fill flag); backtests stay silent by design get_financial_screenmin_roe/min_revenue/min_profitnow effective β filters on the latest essentially-complete quarterly report and fails closed when it is unavailable, instead of silently ignoring the parameters- PIT look-ahead leaks sealed β snapshot-style public APIs (valuations, ST status, sector constituents, full-market snapshots, and more) now emit
FutureWarninginside backtests, or raise underavoid_future_data=True walk_forward_analysisis now a true rolling window, Cornish-Fisher VaR added, annualization unified to 244 trading days, consistentddof=1across statisticsexamples/18_grid_trading.pyrewritten β 0 fills β 146 fills, max drawdown 97.4% β -19%
Docs
- Sitewide documentation accuracy overhaul: three pages documenting non-existent APIs rewritten, the flagship tutorial example that crashed on run fixed, full Chinese/English sync; custom 404 page, OG share cards, and typography polish
- Docs verified via
mkdocs build --strictplus a bilingual consistency check
Verification
- Full test suite: 1440 passed (including the isolated wheel-install audit),
mkdocs build --strictclean - Full details: Changelog