Skip to content

feat: enhance crypto DCA strategies with smart sizing, escape, and backtest validation#37

Merged
Pigbibi merged 1 commit into
mainfrom
feat/smart-dca-enhancement
Jun 28, 2026
Merged

feat: enhance crypto DCA strategies with smart sizing, escape, and backtest validation#37
Pigbibi merged 1 commit into
mainfrom
feat/smart-dca-enhancement

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Enhances all three crypto strategies with smart features comparable to the IBIT Smart DCA on the US equity side.

Changes

crypto_btc_dca (81→550 lines):

  • AHR999 cycle multiplier (bottom 3.0x / accumulation 2.25x / DCA 1.5x / expensive skip)
  • Drawdown-based smart sizing (severe 3.0x / deep 2.25x / mild 1.5x)
  • Z-score exit (逃顶): MVRV Z-Score → reduce BTC to 50%/25%, park in USDT
  • Execution window: monthly day 25 ± 5 days
  • Bilingual i18n (Chinese/English)

crypto_trend_rotation:

  • Fix empty btc_snapshot bug (was passing {} → rotation never triggered)
  • Circuit breaker: suspend trend positions when BTC below SMA200
  • Volatility-based position scaling
  • i18n signal descriptions

crypto_equity_combo:

  • Simplify to pure combinator (~50% code reduction)
  • BTC leg now delegates to enhanced smart DCA (was previously bare equity-scaled ratio)

Infrastructure:

  • Extract shared utilities to _utils.py (eliminates ~80 lines of duplication)
  • Backtest script comparing 5 DCA strategies (2021-2026)
  • 35 new unit tests

Backtest Results (2021-2026)

Strategy Final Value Calmar
Ordinary DCA $73,806 6.23
Smart (AHR999) $154,633 7.88
Smart (Full) $175,796 6.31

Verification

  • 61 unit tests pass
  • Backtest validates 2.4x outperformance of smart over ordinary DCA

🤖 Generated with Claude Code

- crypto_btc_dca: add AHR999 cycle multiplier, drawdown-based sizing,
  Z-score exit (逃顶), execution window, and bilingual i18n
- crypto_trend_rotation: fix empty btc_snapshot bug, add circuit breaker
  and volatility-based position scaling
- crypto_equity_combo: simplify to pure combinator, delegate BTC leg
  to enhanced smart DCA
- Extract shared utilities to _utils.py
- Add backtest script comparing 5 DCA strategies (2021-2026)
- Update catalog configs and entrypoints

Co-Authored-By: Claude <noreply@anthropic.com>
@Pigbibi Pigbibi merged commit 407efea into main Jun 28, 2026
1 check failed
@Pigbibi Pigbibi deleted the feat/smart-dca-enhancement branch June 28, 2026 21:58
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