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:
7
main.py
7
main.py
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user