¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

order quantity gets systematically set to 1


 

Hello, not sure what I am doing wrong here, just generating limit orders similarly to the IB example, but the quantity gets set to 1.. why?
Contract is vanilla FX CASH pairs.

def generate_limit_order(action: str, quantity: float, limitPrice: float):
print(f'{quantity=}') # prints quantity=163233.980189104
order = Order()
order.action = action
order.orderType = "LMT"
order.totalQuantity = quantity
print(f'{order.totalQuantity=}') # prints order.totalQuantity=163233.980189104
order.lmtPrice = limitPrice
return order
then

api.placeOrder(orderId, strategy.target.contract, order)
Run:
Order Message:
BUY 1 AUD.NZD Forex
Warning: Your order size is below the AUD 25000 IdealPro minimum and will be routed as an odd lot order.

Join [email protected] to automatically receive all group messages.