get_atm() hardcodes step=50 — invalid for indices with different step sizes (e.g. SENSEX step=100)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Start with get_atm() in src/fastbt/backtest/context.py at the cited lines and trace how the backtest engine or data source provides underlying information to the context. Check how available strikes are represented and whether step size can be determined or configured reliably. Done means get_atm() returns valid strikes for indices with different step sizes, with tests covering the reported SENSEX case and existing NIFTY behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug
get_atm(step=50) in src/fastbt/backtest/context.py (lines 112
and 121) defaults to step=50, which is only correct for
NIFTY. Other indices use different step sizes (SENSEX=100,
BANKNIFTY=100, etc.), producing invalid strikes.
Reproduction
SENSEX spot = 85050
ctx.get_atm() # returns 85050 (wrong — not a valid
SENSEX strike)
ctx.get_atm(step=100) # returns 85100 (correct)
Observed Impact
When running ORB strategy on SENSEX data, the engine tried to
ctx.get_atm() # returns 85050 (wrong — not a valid SENSEX strike)
ctx.get_atm(step=100) # returns 85100 (correct)
Observed Impact
When running ORB strategy on SENSEX data, the engine tried to fetch instruments like 85050CE, 84650CE, 84100CE — none of
which exist. This silently produces fewer trades or incorrect fills.
Log warning:
Lazy fetch for '85050CE' at tick '11:16:00'. Consider calling ctx.prefetch(Instrument(85050, 'CE')) in on_day_start() for
better performance.
Current Workaround
Strategy code must explicitly pass step_size and call ctx.get_atm(self.step_size) everywhere. This is fragile — any missed
call silently breaks on non-50-step indices.
Suggested Fix
Make step configurable at the engine or data-source level so get_atm() uses the correct step for the underlying without
requiring every strategy to pass it manually. Options:
- Add step_size to BacktestEngine or DuckDBVortexLoader, propagate to context
- Detect step from the data (scan available strikes)
- At minimum, document that step=50 is NIFTY-specific
- 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
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của uberdeveloper/fastbt
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
uberdeveloper/fastbt#31 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
uberdeveloper/fastbt#30 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
uberdeveloper/fastbt#28 ·
-
FB-008: close_trade mixes price and tick; stale exits are silent (zero-P&L fallback) [silent-wrong]Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
uberdeveloper/fastbt#27 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
uberdeveloper/fastbt#26 ·
Tất cả issue của uberdeveloper/fastbt
Issue tương tự
-
`LazyFrameRemote` and `ExecuteRemote` sinks do not accept `Path`, like `LazyFrame` sinks do.Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
WingedGuardian/GENesis-AGI#3375 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
githubnext/gh-aw-workshop#4601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
approved Good First Issue scope: docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
hiero-ledger/hiero-sdk-python#2730 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày