feat(vol_breakout): 15m 현물 롱 라이브·모니터·cron 운영 추가
vol_breakout 멀티종목 tick, vol_live HTML 모니터, 마감 봉만 저장하는 캔들 다운로드, 텔레그램 체결 알림, cron/watch 감시 스크립트 및 테스트를 포함한다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
import requests
|
||||
@@ -131,6 +132,50 @@ class TelegramNotifier:
|
||||
|
||||
return self.send_message("\n".join(lines))
|
||||
|
||||
def notify_vol_breakout_trade(
|
||||
self,
|
||||
*,
|
||||
mode: str,
|
||||
symbol: str,
|
||||
side: str,
|
||||
price: float,
|
||||
order_krw: float,
|
||||
order_coin: float,
|
||||
equity_krw: float,
|
||||
reason: str = "signal_vol_breakout",
|
||||
ts: str | None = None,
|
||||
pnl_krw: float | None = None,
|
||||
pnl_pct: float | None = None,
|
||||
) -> bool:
|
||||
"""vol_breakout 현물 롱 체결 알림 (Binance live_engine 형식)."""
|
||||
mode_txt = "실거래" if mode == "live" else "페이퍼"
|
||||
market = f"{symbol.upper()}KRW"
|
||||
time_txt = (ts or datetime.now().strftime("%Y-%m-%d %H:%M:%S"))[:19]
|
||||
|
||||
if side == "buy":
|
||||
text = (
|
||||
f"[{mode_txt}] 롱 진입(매수)\n"
|
||||
f"{market} @ {price:,.2f}\n"
|
||||
f"수량 {order_coin:.6f} (≈{order_krw:,.0f}원)\n"
|
||||
f"사유 {reason}\n"
|
||||
f"시각 {time_txt}"
|
||||
)
|
||||
else:
|
||||
pnl_line = ""
|
||||
if pnl_krw is not None and pnl_pct is not None:
|
||||
pnl_line = (
|
||||
f"손익 {pnl_krw:+,.0f}원 ({pnl_pct:+.3f}%)\n"
|
||||
)
|
||||
text = (
|
||||
f"[{mode_txt}] 롱 청산(매도)\n"
|
||||
f"{market} @ {price:,.2f}\n"
|
||||
f"{pnl_line}"
|
||||
f"자본 {equity_krw:,.0f}원\n"
|
||||
f"사유 {reason}\n"
|
||||
f"시각 {time_txt}"
|
||||
)
|
||||
return self.send_message(text)
|
||||
|
||||
def notify_trade_failure(
|
||||
self,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user