forward_test_rules
Forward-test trading rules on FLOW-generated price paths to identify which rules help or hurt. Returns combined strategy performance and per-rule attribution using identical paths.
Instructions
Forward-test systematic trading rules against FLOW-generated price paths. Returns TWO levels of output: • combined_strategy — ALL rules applied together in priority order on every path. This is your actual strategy performance vs the base static portfolio. • rule_attribution — each rule tested individually to show which rules help vs hurt.
How it works:
Loads the FLOW price paths (same N paths for every evaluation — fair comparison)
Steps through each path day-by-day, applies rules in priority order, tracks P&L
Returns Sharpe, CVaR, max drawdown, return for combined strategy and each rule alone
IMPORTANT: The FLOW model must include paths for ALL features referenced in rule triggers (both portfolio assets AND conditioning factors like VIX, DXY, etc.). Rules referencing features not in the FLOW model will silently fail — check warnings in the response. For checking rules against today's real market data (no FLOW dependency), use evaluate_rules instead.
Prerequisites: (1) create rules with create_rule; (2) activate them with toggle_rule(is_active=True); (3) generate FLOW paths with generate_flow_paths. If rule_ids is omitted, tests all active rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule_ids | No | Specific rule UUIDs to test. Omit to test all active rules. | |
| flow_job_id | Yes | Completed FLOW job ID | |
| portfolio_id | Yes | Portfolio UUID |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |