Voyz / ibeam

IBeam is an authentication and maintenance tool used for the Interactive Brokers Client Portal Web API Gateway.
Apache License 2.0
523 stars 106 forks source link

Client Portal API question: How to get commission cost of a filled order? #182

Open heydavid525 opened 3 months ago

heydavid525 commented 3 months ago

This is not directly related to ibeam but it's a major blocker on adopting the CP API for me so want to see what folks do.

There's GET /iserver/account/trades endpoint that has the commission. But it's not useful because:

  1. It doesn't reflect the recent fills. I think it only refresh once per session.
  2. There's no foreign key in the order APIs to link a filled order to execution ID (e.g. 0000e0d5.662a73b3.01.01). So complex logic is needed to match them.

The only way I can think of is to just estimate the commission based on IB's fee schedule.

Curious what do folks do to track commission? Commissions add up over time especially for more frequent orders so I want to keep track of them. It's easy to do in TWS/Gateway.

Thanks in advance for the help!

Voyz commented 3 months ago

Hey @heydavid525 great question! I think one suggestion to find the expected way of doing this would be to talk to the IBKR API support directly. If there is a good way, they'll know about it 👍

heydavid525 commented 3 months ago

Hi @Voyz Yeah I already sent them support ticket in the web portal. They haven't been very responsive though unfortunately. If I hear back I'll share here.