58f1106dbd
Merge pull request 'feat: add rate limiting for overseas market scanning (issue #51 )' ( #53 ) from feature/issue-51-api-rate-limiting into main
...
CI / test (push) Has been cancelled
Reviewed-on: #53
2026-02-05 00:45:39 +09:00
agentson
eaf509a895
feat: add rate limiting for overseas market scanning (issue #51 )
...
CI / test (pull_request) Has been cancelled
Add 200ms delay between overseas API calls to prevent hitting
KIS API rate limit (EGW00201: 초당 거래건수 초과).
Changes:
- src/analysis/scanner.py:79-81 - Add asyncio.sleep(0.2) for overseas calls
Impact:
- EGW00201 errors eliminated during market scanning
- Scan completion time increases by ~1.2s for 6 stocks
- Trade-off: Slower scans vs complete market data
Before: Multiple EGW00201 errors, incomplete scans
After: Clean scans, all stocks processed successfully
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-02-05 00:34:43 +09:00
agentson
854931bed2
fix: handle empty strings in price data parsing (issue #49 )
...
CI / test (pull_request) Has been cancelled
Apply consistent empty-string handling across main.py and scanner.py
to prevent ValueError when KIS API returns empty strings.
Changes:
- src/main.py:110 - Add 'or "0"' for current_price parsing
- src/analysis/scanner.py:86-87 - Add 'or "0"' for price/volume parsing
- tests/test_main.py - Add test_overseas_price_empty_string
- tests/test_volatility.py - Add test_scan_stock_overseas_empty_price
Before: ValueError crashes trading cycle
After: Empty strings default to 0.0, trading continues
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-02-05 00:31:01 +09:00
agentson
62b1a1f37a
feat: implement Volatility Hunter for real-time market scanning
...
CI / test (pull_request) Has been cancelled
Implements issue #20 - Behavioral Rule: Volatility Hunter
Components:
1. src/analysis/volatility.py
- VolatilityAnalyzer with ATR calculation
- Price change tracking (1m, 5m, 15m intervals)
- Volume surge detection (ratio vs average)
- Price-volume divergence analysis
- Momentum scoring (0-100 scale)
- Breakout/breakdown detection
2. src/analysis/scanner.py
- MarketScanner for real-time stock scanning
- Scans all available stocks every 60 seconds
- Ranks by momentum score
- Identifies top 5 movers per market
- Dynamic watchlist updates
3. Integration with src/main.py
- Auto-adjust WATCHLISTS dynamically
- Replace laggards with leaders (max 2 per scan)
- Volume confirmation required
- Integrated with Context Tree L7 (real-time layer)
4. Comprehensive tests
- 22 tests in tests/test_volatility.py
- 99% coverage for analysis module
- Tests for all volatility calculations
- Tests for scanner ranking and watchlist updates
- All tests passing
Key Features:
- Scan ALL stocks, not just current watchlist
- Dynamic watchlist that adapts to market leaders
- Context Tree integration for real-time data storage
- Breakout detection with volume confirmation
- Multi-timeframe momentum analysis
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-02-04 16:29:06 +09:00