Files
fidc-backtest-engine/docs/rqalpha-gap-roadmap.md
2026-04-23 20:03:49 -07:00

3.4 KiB

RQAlpha Gap Roadmap

This document tracks the remaining RQAlpha backtest capabilities that are not yet fully aligned in fidc-backtest-engine, and the implementation order we are following.

Scope

This roadmap focuses on the China A-share stock backtest path first. Multi-asset coverage such as futures/options is tracked separately and is not part of the current alignment pass.

Remaining Gaps

Phase 1: Strategy API parity

  • order_to / target-shares style explicit order primitive
  • order_target_portfolio(_smart) style public API surface
  • richer explicit order styles exposed to platform scripts

Phase 2: Scheduling and execution surface

  • minute-level time_rule semantics like market_open, market_close, physical_time
  • finer 1m / tick strategy execution entrypoints beyond open_auction and on_day
  • scheduled actions evaluated against explicit intraday times

Phase 3: Universe and subscription model

  • update_universe
  • subscribe
  • unsubscribe
  • tick-frequency subscription guards exposed at strategy API level

Phase 4: Algo order parity

  • VWAPOrder first-class explicit action parity (order.vwap_value/percent)
  • TWAPOrder first-class explicit action parity (order.twap_value/percent)
  • order_target_portfolio_smart(..., order_prices=AlgoOrder, valuation_prices=...)

Phase 5: Position accounting parity

  • trading_pnl
  • position_pnl
  • dividend_receivable
  • richer position lifecycle fields exposed to strategy runtime

Phase 6: Strategy data API parity

  • history_bars numeric helper for daily, intraday, and tick fields
  • current_snapshot
  • instrument / instruments / all_instruments
  • get_trading_dates / get_previous_trading_date / get_next_trading_date
  • phase-aware minute/tick history cursor semantics matching the active bar or tick callback

Phase 7: Remaining stock data-source API parity

  • is_suspended
  • is_st_stock
  • get_price style date-range tabular API
  • active_instruments
  • instruments_history

Phase 8: Order object API parity

  • open-order status and unfilled quantity exposed to strategy runtime
  • final order object lookup by order id
  • order average fill price and transaction cost aggregation

Phase 9: Account / portfolio API parity

  • stock-account runtime view (ctx.account() / ctx.portfolio_view())
  • cash, available_cash, frozen_cash, market_value, total_value exposed to strategy runtime and DSL
  • unit_net_value, static_unit_net_value, daily_pnl, daily_returns, total_returns, transaction_cost, trading_pnl, and position_pnl exposed to strategy runtime and DSL
  • explicit deposit / withdraw API
  • financing liability / repay API

Execution Order

  1. Close the explicit order API gap with target-shares / order_to parity.
  2. Add public batch target-portfolio semantics.
  3. Expand scheduler to intraday time rules.
  4. Add dynamic universe APIs.
  5. Add algo-order styles.
  6. Finish position accounting parity.
  7. Continue stock data-source API parity.
  8. Continue order object API parity.
  9. Continue account / portfolio API parity.

Current Step

Active implementation target: continue account parity after exposing the stock account runtime view and core Portfolio fields; next gaps are explicit deposit/withdraw and financing liability APIs.