refactor: 프로젝트명 bithumb으로 변경 및 futures 파이프라인 제거

deepcoin 패키지를 bithumb으로 rename하고, 3단계 live 운영·사이징 튜닝·텔레그램 알림을 통합한다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-06-13 17:47:11 +09:00
parent 4890abd9a6
commit c3334e4f77
129 changed files with 1846 additions and 1642 deletions

View File

@@ -0,0 +1,44 @@
"""SQLite 캔들 조회."""
from __future__ import annotations
from datetime import timedelta
from pathlib import Path
import pandas as pd
from bithumb.data.candle_store import CandleStore
def load_candles(
db_path: Path | str,
symbol: str,
interval_min: int,
lookback_days: int | None = None,
) -> pd.DataFrame:
"""DB에서 캔들 DataFrame을 로드한다.
Args:
db_path: SQLite 경로.
symbol: 코인 심볼 (예: BTC).
interval_min: 분 단위 인터벌 코드.
lookback_days: 최근 N일만 사용. None이면 전체.
Returns:
``datetime``, ``open``, ``high``, ``low``, ``close``, ``volume`` 컬럼.
시간 오름차순 정렬.
"""
store = CandleStore(db_path)
try:
df = store.read_dataframe(symbol, interval_min)
finally:
store.close()
if df.empty:
return df
if lookback_days is not None and lookback_days > 0:
cutoff = df["datetime"].max() - timedelta(days=lookback_days)
df = df[df["datetime"] >= cutoff].reset_index(drop=True)
return df