Repository navigation
Conversation
…e (phase 3, F-46) : FAIL - src/pullback/market.py : matrices float32 + pré-filtre vectorisé identique à rules.detect_consolidation (0 écart sur 12 089 contrôles réels) et au screener momentum. - src/pullback/portfolio.py : moteur événementiel OHLC (gaps payés, pire cas intrajournalier, stop avant cible, frais, change EUR/USD, impôt annuel) ; modes d'ordre intrajournalier en sensibilité. - src/pullback/bench.py : 6 variantes pré-enregistrées, walk-forward 2015-2020 / 2021+, contrôles hasard (40 tirages) et momentum seul, bootstrap, Sharpe déflaté, verdict calculé, rapport généré. - docs/BACKTEST_PULLBACK_2026-10-12.md : test 2021-2026 -22,6 %/an, Sharpe -1,93, espérance -0,55 R, battu par le hasard ; B&H Nasdaq-100 EUR +14,6 %/an. Porte du plan non franchie. - 15 tests moteur ; suite complète 466 passed, 3 skipped. Ne touche ni t212_executor.py ni schedule.py. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| import logging | ||
| import math | ||
| import pickle | ||
| from dataclasses import dataclass, replace |
There was a problem hiding this comment.
WARNING: Unused import replace from dataclasses
replace is imported at src/pullback/bench.py:15 but is never referenced in the new file (the tests build frozen Variant instances via the keyword constructor, e.g. bench.Variant("b", max_dist=0.04), rather than dataclasses.replace). Under the repo's Ruff configuration in pyproject.toml, whose default rule set includes F401, ruff check flags this — remove it before merge.
| from dataclasses import dataclass, replace | |
| from dataclasses import dataclass |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| # 4) sous-univers très liquide (proxy partiel du biais du survivant) | ||
| Bl = Bench(mkt, refs, sig_large) | ||
| Bl.liquid = mkt.liquid(min_dollar_volume=LARGE_CAP_DOLLAR_VOLUME) | ||
| large, _ = Bl.evaluate(best, TEST_START, last) |
There was a problem hiding this comment.
SUGGESTION: Dead assignment to Bl.liquid
Bl = Bench(mkt, refs, sig_large) is only driven through Bl.evaluate(...), which calls build_orders/run_portfolio — neither reads Market.liquid. Market.liquid is consumed only by Bench.ranks() (via momentum_masks); Bl.ranks() is never called in run_bench, so this assignment has no effect on the verdict. The large-cap filter is already applied at signal generation (market.candidate_setups(mkt, mkt.liquid(min_dollar_volume=LARGE_CAP_DOLLAR_VOLUME), ...)), so the line is misleading. Remove it, or keep it with a note if Bl.ranks() is intended later (note: removing is safe only while ranks() stays uncalled on Bl).
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address minor non-behavioral issues before merge Overview
The pullback bench is a careful, well-tested (466 passed, 3 skipped) implementation of the daily pullback method and correctly computes the FAIL verdict from the plan gate (§2.1). I read the three new modules in full plus their dependencies ( Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (7 files)
Reviewed by free · Input: 312.6K · Output: 61.9K · Cached: 1.2M |
Résumé
Phase 3 du plan, empilée sur #111 (elle-même sur #110). Le banc est construit et son verdict, calculé par le code, est FAIL : la porte du plan (§2.1) n'est pas franchie, donc rien n'est construit côté exécution T212.
Résultat (test hors échantillon 2021-01-04 → 2026-10-12, net de frais 25 pb/sens et d'impôt 30 %)
Contenu
src/pullback/market.py: pré-filtre vectorisé, identique àrules.detect_consolidation(0 écart sur 12 089 contrôles réels) et au screener.src/pullback/portfolio.py: moteur événementiel OHLC (gaps payés, pire cas intrajournalier, change, frais, impôt).src/pullback/bench.py: variantes, walk-forward, contrôles, bootstrap, Sharpe déflaté, verdict, rapport.docs/BACKTEST_PULLBACK_2026-10-12.md(généré) + §9 du plan.Décision à prendre
Phases 4 à 7 suspendues. Options : tester l'intraday (données payantes), arrêter la méthode, ou revenir à une base passive.
🤖 Generated with Claude Code