Commit Graph

31 Commits

Author SHA1 Message Date
21in7
4669d08cb4 feat: build_features accepts oi_change and funding_rate params
Made-with: Cursor
2026-03-02 13:50:39 +09:00
21in7
2b315ad6d7 feat: add get_open_interest and get_funding_rate to BinanceFuturesClient
Made-with: Cursor
2026-03-02 13:46:25 +09:00
21in7
c89374410e feat: enhance trading bot functionality and documentation
- Updated README.md to reflect new features including dynamic margin ratio, model hot-reload, and multi-symbol streaming.
- Modified bot logic to ensure raw signals are passed to the `_close_and_reenter` method, even when the ML filter is loaded.
- Introduced a new script `run_tests.sh` for streamlined test execution.
- Improved test coverage for signal processing and re-entry logic, ensuring correct behavior under various conditions.
2026-03-02 01:51:53 +09:00
21in7
9ec78d76bd feat: implement immediate re-entry after closing position on reverse signal
- Added `_close_and_reenter` method to handle immediate re-entry after closing a position when a reverse signal is detected, contingent on passing the ML filter.
- Updated `process_candle` to call `_close_and_reenter` instead of `_close_position` for reverse signals.
- Enhanced test coverage for the new functionality, ensuring correct behavior under various conditions, including ML filter checks and position limits.
2026-03-02 01:34:36 +09:00
21in7
5e6cdcc358 fix: _on_candle_closed async 콜백 구조 수정 — asyncio.create_task 제거
동기 콜백 내부에서 asyncio.create_task()를 호출하면 이벤트 루프
컨텍스트 밖에서 실패하여 캔들 처리가 전혀 이루어지지 않는 버그 수정.

- _on_candle_closed: 동기 → async, create_task → await
- handle_message (KlineStream/MultiSymbolStream): 동기 → async, on_candle await
- test_callback_called_on_closed_candle: AsyncMock + await handle_message로 수정

Made-with: Cursor
2026-03-02 01:00:59 +09:00
21in7
747ab45bb0 fix: test_reload_model 단언을 실제 동작(파일 없으면 폴백 상태)에 맞게 수정
Made-with: Cursor
2026-03-02 00:38:08 +09:00
21in7
6fa6e854ca fix: test_reload_model _model → _lgbm_model 주입 방식으로 수정
Made-with: Cursor
2026-03-02 00:36:47 +09:00
21in7
518f1846b8 fix: 기존 테스트를 현재 코드 구조에 맞게 수정 — MLFilter API, FEATURE_COLS 수, 버퍼 최솟값 반영
Made-with: Cursor
2026-03-02 00:36:13 +09:00
21in7
3bfd1ca5a3 fix: test_mlx_filter _make_X를 FEATURE_COLS 기반으로 수정 — 피처 확장 후 input_dim 불일치 해소
Made-with: Cursor
2026-03-02 00:34:21 +09:00
21in7
bcc717776d fix: RS 계산을 np.divide(where=) 방식으로 교체 — epsilon 이상치 폭발 차단
Made-with: Cursor
2026-03-02 00:30:36 +09:00
21in7
6ae0f9d81b fix: MLXFilter fit/predict에 nan-safe 정규화 적용 (nanmean + nan_to_num)
Made-with: Cursor
2026-03-01 23:53:49 +09:00
21in7
820d8e0213 refactor: 분모 연산을 1e-8 epsilon 패턴으로 통일
Made-with: Cursor
2026-03-01 23:52:59 +09:00
21in7
417b8e3c6a feat: OI/펀딩비 결측 구간을 np.nan으로 마스킹 (0.0 → nan)
Made-with: Cursor
2026-03-01 23:52:19 +09:00
21in7
ab580b18af feat: apply dynamic margin ratio in bot position sizing
Made-with: Cursor
2026-03-01 20:39:07 +09:00
21in7
795689ac49 feat: replace risk_per_trade with margin_ratio in calculate_quantity
Made-with: Cursor
2026-03-01 20:38:18 +09:00
21in7
fe9690698a feat: add get_dynamic_margin_ratio to RiskManager
Made-with: Cursor
2026-03-01 20:37:46 +09:00
21in7
d1af736bfc feat: implement BTC/ETH correlation features for improved model accuracy
- Added a new design document outlining the integration of BTC/ETH candle data as additional features in the XRP ML filter, enhancing prediction accuracy.
- Introduced `MultiSymbolStream` for combined WebSocket data retrieval of XRP, BTC, and ETH.
- Expanded feature set from 13 to 21 by including 8 new BTC/ETH-related features.
- Updated various scripts and modules to support the new feature set and data handling.
- Enhanced training and deployment scripts to accommodate the new dataset structure.

This commit lays the groundwork for improved model performance by leveraging the correlation between BTC and ETH with XRP.
2026-03-01 19:30:17 +09:00
21in7
de933b97cc feat: remove in-container retraining, training is now mac-only
Made-with: Cursor
2026-03-01 18:54:00 +09:00
21in7
e1560f882b feat: add vectorized dataset builder (1x pandas_ta call)
Made-with: Cursor
2026-03-01 18:52:34 +09:00
21in7
7e4e9315c2 feat: implement ML filter with LightGBM for trading signal validation
- Added MLFilter class to load and evaluate LightGBM model for trading signals.
- Introduced retraining mechanism to update the model daily based on new data.
- Created feature engineering and label building utilities for model training.
- Updated bot logic to incorporate ML filter for signal validation.
- Added scripts for data fetching and model training.

Made-with: Cursor
2026-03-01 17:07:18 +09:00
21in7
117fd9e6bc fix: AsyncClient.futures_klines await 누락 수정
Made-with: Cursor
2026-03-01 13:04:02 +09:00
21in7
4940de16fc feat: 봇 시작 시 과거 캔들 200개 프리로드 (즉시 신호 계산 가능)
Made-with: Cursor
2026-03-01 13:02:42 +09:00
21in7
a90618896d feat: 엔트리포인트 및 로깅 설정 완료, 테스트 mock 개선
Made-with: Cursor
2026-03-01 12:54:21 +09:00
21in7
726e9cfd65 feat: TradingBot 메인 루프 구현 (진입/청산/손절/익절)
Made-with: Cursor
2026-03-01 12:53:40 +09:00
21in7
69b5675bfd feat: WebSocket 실시간 캔들 스트림 구현
Made-with: Cursor
2026-03-01 12:52:40 +09:00
21in7
4bab4cdba3 feat: 리스크 매니저 구현 (일일 손실 한도, 포지션 수 제한)
Made-with: Cursor
2026-03-01 12:52:05 +09:00
21in7
8bbf376425 feat: Notion 거래 이력 저장 모듈 구현
Made-with: Cursor
2026-03-01 12:51:27 +09:00
21in7
7a3dde2146 feat: 복합 기술 지표 모듈 구현 (RSI/MACD/BB/EMA/ATR/StochRSI)
Made-with: Cursor
2026-03-01 12:50:51 +09:00
21in7
b1a7632bbe feat: BinanceFuturesClient 구현
Made-with: Cursor
2026-03-01 12:49:26 +09:00
21in7
81b7a7f714 feat: Config 모듈 추가 (Notion 연동 포함)
Made-with: Cursor
2026-03-01 12:48:34 +09:00
21in7
60b0e01a01 chore: 프로젝트 초기 설정 및 의존성 추가
Made-with: Cursor
2026-03-01 12:48:03 +09:00