Repository navigation
fix(propose): break a trend_add only past 3% under its ma50 - #69
Merged
Merged
Conversation
One close under the MA50 exited a trend_add on noise: on 181 sampled US names 2014-2026 that rule exited 9.1x a year and 59% of exits closed back above within 5 sessions. 3% under cuts it to 4.0x and 25%, median CAGR 3.7% -> 5.3%, same median drawdown. signals.MA_TREND_BUFFER holds the number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
A
trend_addgot an EXIT card (sell it all, no decision) on any single close under its MA50, which in earnings-season tape fires on noise. On 181 randomly sampled US universe names 2014-2026 (exit on the rule, re-enter on the first close back above), one close under the line exited 9.1x a year and 59% of those exits closed back above within 5 sessions.What changed
trend_addbreaks only on a close more thansignals.MA_TREND_BUFFER(3%) under its MA50; between the line and 3% under, the trend is reported intact.Not changed: the trailing-stop half of the
trend_addrule,value_dip/pullback_addinvalidation, MAE DECIDE, the book's own stop veto.Verification
Gate: ruff clean · pytest 511/511 · 268ca02
Red-first: tests/test_allocator.py::test_trend_add_breaks_only_past_the_ma50_buffer watched red on origin/main engine, green at 268ca02
Live: not run — the study above is the evidence; the daily cron picks this up on merge
Not verified: buffer depth beyond 3% is a policy choice (deeper keeps trading exits for a looser rule, converging on no trend exit); study re-entry model is mechanical, real EXITs do not auto re-enter
Problems found
none
Follow-ups
none
Reviewer notes
Start here: kuroshio/core/allocator/engine.py trend_add branch
Reproduce: pytest tests/test_allocator.py -k ma50_buffer
🤖 Generated with Claude Code