wvietor / ibkr_rust

A Rust port of the Interactive Brokers TWS API.
Apache License 2.0
10 stars 3 forks source link

Execution error and warn decode messages #7

Open fraschm1998 opened 1 month ago

fraschm1998 commented 1 month ago
2024-10-02T16:14:55.688172Z ERROR decode_msg_remote{fields=["5", "0", "756733", "SPY", "STK", "", "0", "?", "", "SMART", "USD", "SPY", "SPY", "SELL", "10", "MKT", "0.0", "0.0", "DAY", "", "DU1827364", "", "0", "", "0", "7508265", "0", "0", "0", "", "7508265.0/DU1827364/100", "", "", "", "", "", "", "", "", "0", "", "-1", "0", "", "", "", "", "", "2147483647", "0", "0", "0", "", "3", "0", "0", "", "0", "0", "", "0", "None", "", "0", "", "", "", "?", "0", "0", "", "0", "0", "", "", "", "", "", "0", "0", "0", "2147483647", "2147483647", "", "", "0", "", "IB", "0", "0", "", "0", "0", "Filled", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "", "", "", "", "", "0", "0", "0", "None", "1.7976931348623157E308", "568.58", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "0", "", "", "", "0", "1", "0", "0", "0", "", "", "0", "", "", "", "", "", ""] tx=Sender { chan: Tx { inner: Chan { tx: Tx { block_tail: 0x555d782dea90, tail_position: 0 }, semaphore: Semaphore { semaphore: Semaphore { permits: 10 }, bound: 10 }, rx_waker: AtomicWaker, tx_count: 1, rx_fields: "..." } } } rx=Receiver { chan: Rx { inner: Chan { tx: Tx { block_tail: 0x555d782de510, tail_position: 0 }, semaphore: Semaphore { semaphore: Semaphore { permits: 10 }, bound: 10 }, rx_waker: AtomicWaker, tx_count: 1, rx_fields: "..." } } }}: ibapi::client: Error in decoding incoming message from API. Error message: Decode error in function open order msg. Cause Failed to parse integer field client_id. Cause: cannot parse integer from empty string
[Wrapper::order_status][ibkr_rust/src/wrapper.rs:28:1] (&status,) = (
    Filled(
        OrderStatusCore {
            order_id: 0,
            fill: Some(
                Fill {
                    filled: 10.0,
                    average_price: 569.57,
                    last_price: 569.57,
                },
            ),
            remaining: 0.0,
            permanent_id: 7508265,
            parent_id: None,
            client_id: 0,
            why_held: None,
            market_cap_price: None,
        },
    ),
)
2024-10-02T16:14:55.689690Z ERROR decode_msg_remote{fields=["5", "0", "756733", "SPY", "STK", "", "0", "?", "", "SMART", "USD", "SPY", "SPY", "SELL", "10", "MKT", "0.0", "0.0", "DAY", "", "DU1827364", "", "0", "", "0", "7508265", "0", "0", "0", "", "7508265.0/DU1827364/100", "", "", "", "", "", "", "", "", "0", "", "-1", "0", "", "", "", "", "", "2147483647", "0", "0", "0", "", "3", "0", "0", "", "0", "0", "", "0", "None", "", "0", "", "", "", "?", "0", "0", "", "0", "0", "", "", "", "", "", "0", "0", "0", "2147483647", "2147483647", "", "", "0", "", "IB", "0", "0", "", "0", "0", "Filled", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.16072", "", "", "USD", "", "0", "0", "0", "None", "1.7976931348623157E308", "568.58", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "1.7976931348623157E308", "0", "", "", "", "0", "1", "0", "0", "0", "", "", "0", "", "", "", "", "", ""] tx=Sender { chan: Tx { inner: Chan { tx: Tx { block_tail: 0x555d782dea90, tail_position: 0 }, semaphore: Semaphore { semaphore: Semaphore { permits: 10 }, bound: 10 }, rx_waker: AtomicWaker, tx_count: 1, rx_fields: "..." } } } rx=Receiver { chan: Rx { inner: Chan { tx: Tx { block_tail: 0x555d782de510, tail_position: 0 }, semaphore: Semaphore { semaphore: Semaphore { permits: 10 }, bound: 10 }, rx_waker: AtomicWaker, tx_count: 1, rx_fields: "..." } } }}: ibapi::client: Error in decoding incoming message from API. Error message: Decode error in function open order msg. Cause Failed to parse integer field client_id. Cause: cannot parse integer from empty string
[Wrapper::order_status][ibkr_rust/src/wrapper.rs:28:1] (&status,) = (
    Filled(
        OrderStatusCore {
            order_id: 0,
            fill: Some(
                Fill {
                    filled: 10.0,
                    average_price: 569.57,
                    last_price: 569.57,
                },
            ),
            remaining: 0.0,
            permanent_id: 7508265,
            parent_id: None,
            client_id: 0,
            why_held: None,
            market_cap_price: None,
        },
    ),
)
2024-10-02T16:14:55.690200Z  WARN decode_msg_remote{fields=["59", "1", "00025b49.66fd05e8.01.01", "1.16072", "USD", "-37.36124", "1.7976931348623157E308", "", ""] tx=Sender { chan: Tx { inner: Chan { tx: Tx { block_tail: 0x555d782dea90, tail_position: 0 }, semaphore: Semaphore { semaphore: Semaphore { permits: 10 }, bound: 10 }, rx_waker: AtomicWaker, tx_count: 1, rx_fields: "..." } } } rx=Receiver { chan: Rx { inner: Chan { tx: Tx { block_tail: 0x555d782de510, tail_position: 0 }, semaphore: Semaphore { semaphore: Semaphore { permits: 10 }, bound: 10 }, rx_waker: AtomicWaker, tx_count: 1, rx_fields: "..." } } }}: ibapi::decode: Unimplemented incoming message. Fields: IntoIter(["59", "1", "00025b49.66fd05e8.01.01", "1.16072", "USD", "-37.36124", "1.7976931348623157E308", "", ""])
[Wrapper::commission_report][ibkr_rust/src/wrapper.rs:28:1] (&commission_report,) = (
    CommissionReport {
        exec_id: "00025b49.66fd05e8.01.01",
        commission: 1.16072,
        currency: UsDollar,
        realized_pnl: -37.36124,
        yld: None,
        yld_redemption_date: None,
    },
)
wvietor commented 1 month ago

Thanks for flagging. This warning is a false positive. I forgot to remove it after I implemented the commission report callback.

wvietor commented 1 month ago

Just updated. Should be all set.

wvietor commented 1 month ago

Sorry, missed the open_order_msg errors. Fixing now

wvietor commented 1 month ago

Just pushed a quick fix for this. Ultimately, I will need to implement a better open_order message -- probably with some feature like the contract "proxy"