Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

FB-008: close_trade mixes price and tick; stale exits are silent (zero-P&L fallback) [silent-wrong]

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend, data

Research direction

Start in strategy.py at the cited lines 231 and 245, then trace get_price and the trade fields used by close_trade. Check existing tests for stale prices, fill-forward behavior, and no-price exits. Done means one tick source is used, the exit lag is recorded, and an optional maximum lag is enforced with tests covering the stated cases.

Written by the indexing model from the issue text.

Description

bug

Severity: silent-wrong · Source: BUGS_FASTBT.md (2026-10-09; seen in skill trial 11)

  • The price is read at ctx.tick (strategy.py:231), but the trade is stamped with the tick argument (strategy.py:245). A caller passing a different tick records a price from one time against another.
  • The lag returned by get_price is discarded, so a fill-forward exit of any age is accepted: from yesterday's close, or from a contract with no bars left.
  • With no price at all, the exit price falls back to the entry price (zero P&L) with only a logger.warning.

Observed: on the stale 2025-11-27 monthly gap, the fill-forward and live-only variants exit differently.

Workaround: check the lag before closing; pin the ffill-vs-live exit policy.
Fix: use one tick source; store exit_lag on the trade; add an optional max_exit_lag.

Dominant language
Python
Stars
28
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uberdeveloper/fastbt

All issues in uberdeveloper/fastbt

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.