Files
nofx/trader
ZhouYongyou f1e981b207 fix(decision+trader): limit candidate coins & fix news collection
## Changes

### 1. decision/engine.go
- Fix calculateMaxCandidates to enforce proper limits (was returning all candidates)
- Dynamic limits based on position count:
  * 0 positions: max 30 candidates
  * 1 position: max 25 candidates
  * 2 positions: max 20 candidates
  * 3+ positions: max 15 candidates
- Prevents Prompt bloat when users configure many coins

### 2. trader/auto_trader.go
- Fix news collection to use actual positions + candidates (was hardcoded to BTC only)
- Add extractNewsSymbols() helper function
- Collect news for:
  * All current positions (highest priority)
  * Top 5 candidate coins
  * Always include BTC (market indicator)
  * Max 10 coins total (avoid excessive API calls)
- Properly convert symbols for news API (lowercase, remove USDT suffix)

## Impact
- Prevents excessive market data fetching
- Makes news feature actually useful (was only fetching BTC news)
- Better resource utilization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 00:23:04 +08:00
..