开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Quantity for MIDPRICE orders


 

Hello,

When placing a Midprice order via the TWS API, I do not have the quantity, since the actual price isn't known yet. But I do have the $ amount to use for the order.

I know that TWS, mobile app etc. allow placing the order using $ amount, and then the app calculates the quantity, rounded down to the nearest integer. Is this also possible via the API i.e. provide the $ amount instead of quantity?

Thank you!


 

No, the API does not provide it directly. You need to get your cash amount and calculate yourself.

https://ib-api-reloaded.github.io/ib_async/api.html#ib_async.ib.IB.accountValues


 

Correct. But it is possible for forex pairs. You can specify quantity in Cash. Using cashQty field of order. This is to specify the quantity in second currency in pair.


On Fri, 5 Jul, 2024, 08:39 biney59 via , <biney59=[email protected]> wrote:
No, the API does not provide it directly. You need to get your cash amount and calculate yourself.