Skip to content

Fix conditional limit slippage and trade-triggered quote execution - #203

Open
stefan-jansen wants to merge 10 commits into
mainfrom
fix/conditional-quote-limit-20261123
Open

stefan-jansen wants to merge 10 commits into
mainfrom
fix/conditional-quote-limit-20261123

Conversation

@stefan-jansen

@stefan-jansen stefan-jansen commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem and behavior

Closes #183. Closes #192.

Resting intrabar limits and bracket take-profits can now opt into limit_slippage_policy="clamp": an eligible execution is capped at the order limit after impact/slippage. The default remains defer, and neither policy makes an out-of-bounds bid/ask executable. Fees remain separate from the execution-price bound.

conditional_order_mode="trade_quote" activates pending STOP/LIMIT/STOP_LIMIT orders from the observed trade (close) and executes buys at ask and sells at bid. Missing opposite quotes raise instead of inventing liquidity; events for other assets leave the order pending. Stop activation persists across partial fills, cancellation works, and exported fills retain the original trigger_price and activation time. This mode uses the observed close rather than inferring an OHLC path.

The guide describes these assumptions, defaults and liquidity limits. The stable API snapshot records only additive keyword/default and nullable artifact fields, preserving existing positional arguments and older artifact loading.

Verification

  • New public Engine/config cases fail on 99ee9970f74dbde59d2863189108146fc60e9685; 95 focused execution/property/artifact/export cases pass after the repair.
  • A sparse-asset error found during review was reproduced through Engine and fixed. Partial limits/stops, cancellation, bracket siblings, buy/sell price bounds, per-order fees, cash and trigger artifact round-trips are covered.
  • Five strengthened order properties require actual eligible fills, allow shorts so sell cases run, and fail when the producing FillEngine is mutated to return no fills. Deadlines are disabled for correctness properties, preserving all 200 examples.
  • Fresh native correctness: 66 synthetic comparisons pass, two configurations explicitly unsupported; all 17 frozen historical-strategy comparisons pass.
  • The built wheel matches all 114 runtime modules and passes 986 installed Data/Engineer/Diagnostic, migration, accounting and execution cases with zero skips; both documented migration CLIs pass. Pinned producer sources are those in validation/successor-integration-requirements.txt.
  • Full source suite with pinned producers: 3,331 passed, 14 explicit optional benchmark/native skips. All hooks pass; strict MkDocs and 11,945 rendered links/52 external destinations pass. Required hosted checks must pass at the final head before merge.

No new performance measurements or claims are introduced. Opt-in behaviors do not change the retained strategies' defaults; runners, inputs and dependencies are unchanged. The measured-path impact review certifies the retained timing evidence under the existing validator.

AI assistance

OpenAI Codex implemented and reviewed the maintenance changes, reproduced failures, inspected the actual execution and accounting paths, and ran the checks reported above. Original issue authors retain attribution for their reports and proposed policies.

dependabot Bot and others added 9 commits November 23, 2026 11:07
Bumps the github-actions group with 2 updates: [actions/dependency-review-action](https://github.com/actions/dependency-review-action) and [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).


Updates `actions/dependency-review-action` from 5.0.0 to 5.0.1
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](actions/dependency-review-action@a1d282b...bbc44d1)

Updates `astral-sh/setup-uv` from 10.3.3 to 10.4.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@68559e9...1db35dd)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Base automatically changed from dependabot/github_actions/github-actions-f3f4aea047 to main November 24, 2026 19:43
@stefan-jansen
stefan-jansen marked this pull request as ready for review November 24, 2026 19:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant