docs(research): the fill-model hazard in externally-sourced strategies (#529) - #584
Merged
Conversation
…cells, five assets (#529)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #529. Milestone: Strategy-API expressiveness. Docs only — no code paths touched; suite green (
uv run pytest -q: 4340 passed, 3 skipped).Where the doc landed, and why
docs/experiments/2026-08-27-external-strategy-evaluation-hazard.md(plus a newest-first index entry indocs/experiments/README.md).Chosen over
docs/research/because the cost-restatement corpus the issue names ("alongside the cost-restatement documents") lives indocs/experiments/— the 08-12 fee curve and the 08-13 restatement are the two records every number in this hazard cites — and becausedocs/experiments/is where the scout skill already directs a proposer to read before writing any output. That is the meet-point the acceptance bar describes. The doc states up front that it reports no new measurement; it is the reading-side analogue of the invariants the 08-13 record demanded.Section shape
self.buy = qty, entryidiom vs keel's fix(strategy): fill entries at the next bar's open, as production's market orders do #258 next-bar-open market fill; the worked example with both numbers; the compounding with ~2.5% round-trip friction ("optimistic on both axes at once").cost_regime/sample_size/evaluation_windowcitation fields are the same discipline; the two are kept in step.Cross-reference points (the acceptance criterion)
Three places, each one where a person proposing a candidate would actually see it:
.claude/skills/keel-asset-scout/SKILL.md(Output 3a, the parameter-proposal section that already frames claims against the fill model) — pointer to the doc, with the instruction that a research brief that has not answered its four questions is not yet interpretable. Force-added per that file's own tracking convention (.claude/is gitignored).docs/superpowers/specs/2026-08-23-strategy-api-expressiveness-prd.md§4.2 — a "Documented (Document the fill-model hazard when evaluating an externally-sourced strategy #529)" cite-back blockquote, making the PRD's second success criterion traceable to where it landed.docs/superpowers/specs/2026-07-24-llm-asset-proposer-design.md§B (the "Strategy proposer — future, own spec" scope) — one line: any future strategy-proposer spec inherits the hazard and must route proposals through the checklist.Plus the
docs/experiments/README.mdindex entry (corpus convention, not counted as a cross-reference).Provenance of each number (all verified against source before writing)
docs/experiments/2026-08-13-restated-under-a-production-faithful-engine.md§3 tableentry = signal_candle.high + buffer_ticksorder_type="market",limit_price=None; "free optionality … and unbounded patience"keel/strategy/backtest.pyandkeel/execution/executor.pyon this branch2 × fee_pct + 2 × slippage_pct)docs/experiments/2026-08-12-fee-curve-and-rsi-meanrev.mdrsi_meanrev1.1631 at median n=38 / 0.8396 across 82 cells at n≥100turtle1.555 gross, three consecutive losing years, 92.7% of PnL in 2025–26docs/superpowers/specs/2026-08-23-strategy-api-expressiveness-prd.md§0/§2/§3One nuance recorded rather than flattened: the 08-13 source carries slightly different medians for the same comparison (§3 table: 60 → 124 and 0.9292; §3.1: 58 → 124 and 0.9219 — both round to the issue's "0.92 → 0.77" and "doubled trade count"). The doc cites both exactly as printed instead of picking one.
Issue #257 vs #258 (issue vs fix) is disambiguated on first mention ("since #258 (the fix for #257)"), since
backtest.pycites #257 and the experiments corpus cites #258.Not done, deliberately
.pydriver — the doc says so up front; every figure is a citation.