Skip to content

fix(soxl): preserve holdings and include research trading costs - #486

Merged
Pigbibi merged 1 commit into
mainfrom
codex/soxl-backtest-accounting-20260909
Sep 9, 2026
Merged

fix(soxl): preserve holdings and include research trading costs#486
Pigbibi merged 1 commit into
mainfrom
codex/soxl-backtest-accounting-20260909

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

SOXL research could report gains from an untraded price round trip, omit trading fees from net returns, and lose fees entirely when targets invested all available cash. Preserve the carried portfolio between signals, reserve cash for cash-inclusive one-way turnover costs, and calculate interval returns from pre-trade equity. Summary turnover now uses executed trades and drawdown includes initial NAV; the existing intraday consumer converts holdings to the same pre-trade return basis.

Normal indicator warmup still carries the portfolio. A strategy exception now fails with a fixed message instead of being reported as a successful cash hold. The legacy same-close research assumption is documented; this does not change the frozen V3/V7 runner, inputs, strategy versions, or prior evidence.

Validation: the six original accounting regressions failed on the base implementation. All 28 related SOXL, archive, shared-summary, and intraday tests now pass, including hand-calculated fee and holding examples; Ruff 0.15.9 on the three changed files and git diff --check pass. No real-data replay, model call, deployment, or trading was performed. Previously generated metrics are not recomputed by this change.

@Pigbibi
Pigbibi merged commit 8dcdb20 into main Sep 9, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/soxl-backtest-accounting-20260909 branch September 9, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant