Skip to content

fix(propose): break a trend_add only past 3% under its ma50 - #69

Merged
HaoweiChan merged 1 commit into
mainfrom
claude/trend-exit-confirm
Oct 20, 2026
Merged

HaoweiChan merged 1 commit into
mainfrom
claude/trend-exit-confirm

Conversation

@HaoweiChan

Copy link
Copy Markdown
Owner

Why

A trend_add got 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

  • A trend_add breaks only on a close more than signals.MA_TREND_BUFFER (3%) under its MA50; between the line and 3% under, the trend is reported intact.
  • EXIT and intact texts (en + zh) name the buffer; README and ARCHITECTURE describe the 3% rule.
rule exits/yr back above ≤5d median CAGR median maxDD
1 close under (old) 9.11 59% 3.7% -47.4%
2 closes in a row 6.48 47% 4.4% -50.4%
3% under (new) 3.95 25% 5.3% -49.9%
5% under 2.74 14% 6.2% -50.6%

Not changed: the trailing-stop half of the trend_add rule, value_dip / pullback_add invalidation, 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

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>
@HaoweiChan
HaoweiChan merged commit 498a328 into main Oct 20, 2026
5 checks passed
@HaoweiChan
HaoweiChan deleted the claude/trend-exit-confirm branch October 20, 2026 18:31
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