Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

FB-007: _handle_cycle_done silently drops still-open legs after on_exit [silent-wrong]

Đang mở
#26 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, data

Hướng nghiên cứu

Read strategy.py around _handle_cycle_done at line 401, then trace how on_exit closes legs and how closed_trades records P&L. Check existing tests for cycle completion and exit handling. Done means any legs still open after on_exit are handled with a CYCLE_DROP reason or an explicit error, with no lost P&L or unlogged positions.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Severity: silent-wrong · Source: BUGS_FASTBT.md (2026-10-09)

After on_exit, _handle_cycle_done runs self.positions.clear() (strategy.py:401). A custom on_exit that leaves any leg open (partial close, a hedge kept on purpose, a close that failed) makes that leg vanish. It is in neither positions nor closed_trades, so its P&L is lost and nothing is logged.

Workaround: on_exit must close everything.
Fix: close the remaining legs with a reason such as CYCLE_DROP, or raise.

Ngôn ngữ chính
Python
Star
28
Fork
17
Merge trung bình
8 giờ 50 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của uberdeveloper/fastbt

Tất cả issue của uberdeveloper/fastbt

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.