Skip to content

IBRK: Partially filled bracket order and SL triggered #2704

@bartlaw

Description

@bartlaw

Bug Report

I have the following setup: bracket limit order with SL and TK market orders. When stop loss is triggered when the limit order is only partially filled, I see the following error:

[ERROR] TESTER-001.InteractiveBrokersClient-003: Error on '_run_msg_handler_processor': ValueError("'quantity' not a positive real, was 0.0")

After that position on NT side is corrupted.

I see the same behavior on the 1.218 version and 1.219 today's nightly build.

Confirmation

Before opening a bug report, please confirm:

  • I’ve re-read the relevant sections of the documentation.
  • I’ve searched existing issues and discussions to avoid duplicates.
  • I’ve reviewed or skimmed the source code (or examples) to confirm the behavior is not by design.
  • I’ve tested this issue using a recent development wheel (dev develop or a nightly) and can still reproduce it.

Expected Behavior

Actual Behavior

Steps to Reproduce the Problem

  1. Fire bracket order from NT with qty = 100
  2. Modify/move the limit order in TWS until it is partially filled.
  3. Move limit order away from current price.
  4. Move the stop order until it is filled.

Code Snippets or Logs

Specifications

  • OS platform: Docker
  • Python version: 3.13.4
  • nautilus_trader version: 1.219.0 docker nightly build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions