refactor: 프로젝트명 bithumb으로 변경 및 futures 파이프라인 제거
deepcoin 패키지를 bithumb으로 rename하고, 3단계 live 운영·사이징 튜닝·텔레그램 알림을 통합한다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,8 +14,8 @@ SRC = ROOT / "src"
|
||||
if str(SRC) not in sys.path:
|
||||
sys.path.insert(0, str(SRC))
|
||||
|
||||
from deepcoin.config import load_settings
|
||||
from deepcoin.operations.runner import OperationsRunner
|
||||
from bithumb.config import load_settings
|
||||
from bithumb.operations.runner import OperationsRunner
|
||||
|
||||
|
||||
def _configure_logging(verbose: bool) -> None:
|
||||
@@ -29,7 +29,7 @@ def _configure_logging(verbose: bool) -> None:
|
||||
|
||||
def main() -> int:
|
||||
"""CLI 진입점."""
|
||||
parser = argparse.ArgumentParser(description="3단계: DeepCoin 운영 tick")
|
||||
parser = argparse.ArgumentParser(description="3단계: Bithumb 운영 tick")
|
||||
parser.add_argument(
|
||||
"--mode",
|
||||
choices=("paper", "live"),
|
||||
@@ -67,19 +67,37 @@ def main() -> int:
|
||||
sync = not args.no_sync
|
||||
|
||||
while True:
|
||||
report = runner.tick(sync_candles=sync)
|
||||
port = report["portfolio"]
|
||||
try:
|
||||
report = runner.tick(sync_candles=sync)
|
||||
except Exception as exc:
|
||||
logging.exception("운영 tick 예외 (복구 후 계속)")
|
||||
if runner.telegram.is_active:
|
||||
runner.telegram.notify_ops_error(
|
||||
mode=settings.ops_mode,
|
||||
symbol=settings.symbol,
|
||||
technique_id=settings.ops_technique_id,
|
||||
stage="main_loop",
|
||||
error=str(exc),
|
||||
)
|
||||
if args.loop <= 0:
|
||||
break
|
||||
time.sleep(args.loop)
|
||||
continue
|
||||
|
||||
port = report.get("portfolio") or {}
|
||||
print("\n=== 3단계 운영 tick ===")
|
||||
print(f"모드: {report['mode']}")
|
||||
if report.get("error"):
|
||||
print(f"오류: [{report.get('error_stage')}] {report.get('error_message')}")
|
||||
print(f"모드: {report.get('mode', settings.ops_mode)}")
|
||||
print(
|
||||
f"최신 봉 후보: {report.get('latest_bar_candidates', 0)} · "
|
||||
f"필터 통과: {report['filtered_signals']} · "
|
||||
f"필터 통과: {report.get('filtered_signals', 0)} · "
|
||||
f"처리 bar: {report.get('pending_bars', [])}"
|
||||
)
|
||||
print(f"이번 체결: {len(report['executions'])}건")
|
||||
print(f"이번 체결: {len(report.get('executions', []))}건")
|
||||
print(
|
||||
f"포트폴리오: 현금 {port['cash_krw']:,.0f}원 · "
|
||||
f"코인 {port['coin_qty']:.8f} {settings.symbol}"
|
||||
f"포트폴리오: 현금 {port.get('cash_krw', 0):,.0f}원 · "
|
||||
f"코인 {port.get('coin_qty', 0):.8f} {settings.symbol}"
|
||||
)
|
||||
print(f"리포트: {settings.ops_report_json}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user