feat: replace volatility breakout with DB-backed real-time trend check

- price_history table on Oracle ADB stores prices every 10 minutes
- check_trend(): current price vs N hours ago (default 1h, +3% threshold)
- check_momentum(): unchanged (MA20 + 2x volume still applies)
- Ticker list cached 5 minutes to avoid 429 rate limits
- Collector starts 30s after boot to avoid simultaneous API calls
- Configurable: TREND_HOURS, TREND_MIN_GAIN_PCT in .env

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
joungmin
2026-02-28 11:26:26 +09:00
parent 9fe3ce488e
commit 80ab004eba
6 changed files with 206 additions and 26 deletions

View File

@@ -19,6 +19,7 @@ logging.basicConfig(
from core.monitor import run_monitor
from core.notify import notify_error, notify_status
from core.price_collector import run_collector
from core.trader import get_positions, restore_positions
from daemon.runner import run_scanner
@@ -56,6 +57,12 @@ def main() -> None:
)
status_thread.start()
# 10분 주기 가격 수집 스레드 (추세 판단용 DB 저장)
collector_thread = threading.Thread(
target=run_collector, daemon=True, name="collector"
)
collector_thread.start()
# 매수 스캔 루프 (60초 주기, 메인 스레드) — 예외 발생 시 Telegram 알림 후 재시작
while True:
try: