Conversation
tools/backtest_wolfe_spec.py implements an external 1H Bullish Wolfe Wave specification as written, separately from scan.py's detector because it differs on the timeframe, the swing depth (3 bars), the window (25 sessions), the stop (0.5 ATR under point 5), the target (the point-4 high), the exit (stop, target or a time exit after 12 sessions) and the absence of a reward:risk filter. Every trade is logged with the specification's schema plus the seven review factors (volume ratio, RSI divergence between points 3 and 5, candle body ratio, projected reward:risk, higher-timeframe EMA trend, nearby support, SPY regime and VIX); the report gives the funnel from structures to trades, the win rate (TP1 hits over closed trades) and the outcome per factor bucket and per year. Where the specification is silent the tool reads it conservatively (no anticipated entry, a 25-bar reclaim window, the structure inside the window up to the entry) and the report states the rules it ran. Yahoo serves hourly bars for the last 730 days only; a longer request is clamped and reported. The backtest-wolfe-spec workflow runs it on the runner's open internet on the intervals asked for (default 1h and 1d, three years) and keeps the rows and reports as artifacts. test_backtest_wolfe_spec.py covers the rules on deterministic hourly fixtures; README, CHANGELOG and the wiki describe the tool, the readings and where the results go. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6cvDsVigeuGGxgEMF7zEy
Run 35362213916 over the 503 current constituents: hourly bars for the last 729 days (Yahoo's intraday limit) and daily bars for the full three years. Hourly: 6225 structures, 3443 trades, TP1 1956 of 3430 closed, a 57.0 % win rate at +0.03 R per trade (+104.20 R). Daily: 1051 structures, 428 trades, TP1 229 of 420 closed, 54.5 % at +0.09 R (+38.83 R). The win rate comes from a target nearer than the stop: 2100 of the 3443 hourly trades carried a projected reward:risk below 1.0, won 67.8 % of the time and paid +0.02 R each, while the above-2.0 bucket won 29.9 % and paid +0.08. That settles the specification's own question about impulse candles with a low initial R:R: they do win more often, and not by enough. None of the seven review factors separates outcomes on both windows. The SPY regime, the VIX and the higher-timeframe EMA trend reverse sign between hourly and daily; RSI divergence is inert on the hourly set (57.1 % against 57.0 %); nearby support is mildly negative on both; volume alone points the same way twice and weakly, the "a feature, not a gate" verdict the volume z-score already got. The hourly rule fires 1.97 times per 1,000 bars against 2.27 on synthetic noise, different generating processes but the same order of magnitude. No scanner rule changes. Wiki 03 carries the tables and the reading; CHANGELOG records the headline figures. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6cvDsVigeuGGxgEMF7zEy
|
The job never analysed the diff. It failed while creating its own agent session: That is GitHub's own code-scanning agent asking its API for a model the API rejects. It is not reachable from repository content, and the run ends before any file is read. It is also not new. The check has failed identically on the last eight pull requests in this repository, over nine days, including every one that merged into
No fix exists to port: the failure is in a GitHub-hosted agent's model selection, outside this repository's code and workflows. I have not re-run it, because eight identical failures across unrelated diffs are stronger evidence than a ninth would be, and a re-run spends Actions minutes on a known-broken third-party agent. If you want the check green, it needs raising with GitHub Advanced Security support rather than a change here. Everything this PR does own is green on the current head: Generated by Claude Code |
Context / why
An external 1H Bullish Wolfe Wave specification was put next to
scan.detect_bullish_wolfe. The two share the geometry and differ on almost everything around it: hourly bars instead of daily, swing points three bars deep instead of five, a fixed 25-session window, a stop half an ATR under point 5 instead of a quarter, the point-4 high as the only target instead of the EPA, a binary exit with a time stop instead of the listing rules, and no reward:risk floor.None of the scanner's replay evidence transfers to that trade, and
scan.py's pipeline (last-bar alignment, the pivot lag, the evaluator) assumes daily bars, so bending it to the specification would test neither. This adds a separate harness that implements the specification as written and logs the seven factors of the accompanying review, so each can be judged by its buckets the waytools/backtest.pyjudges features.Summary of changes
tools/backtest_wolfe_spec.py(new): the replay, with its own constants block.High(P2) > High(P4) > Low(P1) > Low(P3) > Low(P5), both lines falling with 2-4 the steeper.--yearson1his clamped and the report says so.test_backtest_wolfe_spec.py(new): 19 offline tests on deterministic hourly fixtures, covering the swing rule, each geometry invariant one violation at a time, a fixture yielding exactly one trade with the specification's levels, the non-anticipated entry, every trigger-rejection reason, the exit rules including gaps and the time exit, low-R trades kept and bucketed, one position per symbol, a random-walk ceiling, RSI and ATR equal toscan's, the bucket tables, the report and JSON schema, the intraday clamp andmain()through theyfinancestand-in..github/workflows/backtest-wolfe-spec.yml(new): runs the tool per interval (default1h,1d, three years), tees the reports into the job summary and keeps the rows and reports as an artifact.Docs: README layout and limitations, a
[Unreleased]entry inCHANGELOG.md, a dated section on the tuning wiki page with the rules as implemented and the readings above, and rows on the testing page for the new test file and workflow.No change to the scanner, its rules, the nightly job or any existing output.
Test steps
Both pass locally on the pinned Python 3.12 environment: lint clean, 183 tests (19 new), and the random-walk rate is 2.27 trades per 1,000 hourly bars against a ceiling of 4.
For real data, this branch's push starts the
backtest-wolfe-specworkflow; the job summary then carries the funnel, the win rate and the factor tables for both intervals.Doc impact
README.md,CHANGELOG.md,docs/wiki/03-Configuration-and-Tuning.mdanddocs/wiki/04-Testing-and-Contributing.mdare updated in the same commit. The tuning page's new section is written to receive the measured results once a run exists; it currently states the rules and the readings only, and claims no figures.🤖 Generated with Claude Code
https://claude.ai/code/session_01H6cvDsVigeuGGxgEMF7zEy
Generated by Claude Code