get_atm() hardcodes step=50 — invalid for indices with different step sizes (e.g. SENSEX step=100)
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 28
- フォーク
- 17
- 平均マージ
- 8時間 50分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uberdeveloper/fastbt のほかの issue
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
uberdeveloper/fastbt#31 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
uberdeveloper/fastbt#30 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
uberdeveloper/fastbt#28 ·
-
FB-008: close_trade mixes price and tick; stale exits are silent (zero-P&L fallback) [silent-wrong]オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
uberdeveloper/fastbt#27 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
uberdeveloper/fastbt#26 ·
uberdeveloper/fastbt の issue をすべて見る
似ている issue
-
documentation pkg: sphinx-needs
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
useblocks/sphinx-needs#2255 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
home-assistant/core#186538 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
btclib-org/btclib-secp256k1#1181 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pyrite-wiki/pyrite#917 ·
メンテナーはふだん 1 日以内に返信