Skip to content

v2.0.0

Latest

Choose a tag to compare

@AlanFokCo AlanFokCo released this 14 Oct 02:35
· 14 commits to main since this release

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_reason instead 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 with delisted_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_ratio return NaN when no benchmark is available β€” replacing silent defaults; reports render N/A
  • New AlertLevel.NORMAL baseline β€” daily_check() with zero triggers returns NORMAL instead of YELLOW; code treating == YELLOW as "all clear" should check NORMAL instead

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_screen min_roe / min_revenue / min_profit now 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 FutureWarning inside backtests, or raise under avoid_future_data=True
  • walk_forward_analysis is now a true rolling window, Cornish-Fisher VaR added, annualization unified to 244 trading days, consistent ddof=1 across statistics
  • examples/18_grid_trading.py rewritten β€” 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 --strict plus a bilingual consistency check

Verification

  • Full test suite: 1440 passed (including the isolated wheel-install audit), mkdocs build --strict clean
  • Full details: Changelog