Add string factor support

This commit is contained in:
boris
2026-04-23 23:05:43 -07:00
parent 0b0b9333fa
commit 47988cd7e7
6 changed files with 587 additions and 31 deletions

View File

@@ -41,7 +41,7 @@ futures path. Confirmed aligned areas:
| P1 | Futures transaction cost decider | Closed. `FuturesTransactionCostModel` calculates by-money/by-volume open/close/close-today costs from trading parameters. | None. |
| P1 | Futures settlement price mode | Closed. Engine supports configurable settlement price mode and resolves settlement/prev-settlement from factor fields with close/prev_close fallback. | Add dedicated settlement columns if the storage layer later separates them from factors. |
| P1 | Frontend risk validators for futures | Closed for zero quantity, invalid limit price, active-contract, trading-phase, tick-aligned limit price, price-limit, self-trade crossing risk, paused/no executable price, margin, and close-position rejection diagnostics. | Add more exchange metadata columns only when source data exposes them. |
| P2 | Advanced data helper APIs | Closed for the engine-native data model. `DataSet` and `StrategyContext` expose dividends, splits, yield curves, generic factors, margin lists, securities margin, shares, turnover, price change, industry code, stock-connect, fundamentals, financials, point-in-time financials, current performance, dominant future, and dominant future price helpers. | Add string factor support only if source data exposes non-numeric categories. |
| P2 | Advanced data helper APIs | Closed for the engine-native data model. `DataSet` and `StrategyContext` expose dividends, splits, yield curves, numeric and string generic factors, margin lists, securities margin, shares, turnover, price change, industry code/name, stock-connect, fundamentals, financials, point-in-time financials, current performance, dominant future, and dominant future price helpers. | None. |
| P2 | Analyzer/report output | Closed for normalized trades, positions, monthly returns, risk summary, equity curve, benchmark series, metrics, and JSON report bundle via `BacktestResult::analyzer_report(_json)`. | UI/service download endpoints can serialize this report directly. |
| P3 | Mod/config/plugin architecture | Closed for a lightweight engine-native model: `BacktestProcessMod`, `BacktestProcessModLoader`, enabled-name installation, and event-bus lifecycle hooks. | Add concrete production mods/toggles as requirements appear. |
@@ -88,6 +88,8 @@ futures path. Confirmed aligned areas:
margin, shares, turnover, price change, stock-connect, industry code,
fundamentals, financials, point-in-time financials, current performance,
dominant future, and dominant future price helpers.
- [x] String-valued factor ingestion and expression helpers for category fields
such as industry names, concepts, labels, and custom text factors.
- [x] Normalized trades, positions, benchmark, monthly returns, risk summary,
equity curve, metrics, and downloadable analyzer bundle.
- [x] Event-bus process listeners and installable process mods.
@@ -97,5 +99,4 @@ futures path. Confirmed aligned areas:
P0-P2 capability gaps are closed in the engine core. P3 has a lightweight
event-driven extension loader. Remaining work should be driven by concrete
production strategy or UI requirements: optional vendor-specific depth fields,
additional exchange metadata columns, string-valued factor categories, and
service/UI download wiring.
additional exchange metadata columns, and service/UI download wiring.