ib_async icon indicating copy to clipboard operation
ib_async copied to clipboard

"Error 10293, reqId 23956: Cryptocurrency Cash Quantity order cannot specify size"

Open 6nc0r6-1mp6r0 opened this issue 9 months ago • 1 comments

Working from the Notebooks in the documentation for ib_async, I am trying to place a cryptocurrency trade in my paper account as follows:

c = Contract(secType='CRYPTO', conId=541686651, symbol='BTC', exchange='ZEROHASH', currency='USD', localSymbol='BTC.USD', tradingClass='BTC')
ib.qualifyContracts(c)
o = MarketOrder('BUY', totalQuantity=92, cashQty=17)
o.orderId = 0
o.tif = 'GTC'
trade = ib.placeOrder(c, o)

This executes, but is immediately cancelled with the message='Error 10293, reqId 23957: Cryptocurrency Cash Quantity order cannot specify size' in a TradeLogEntry of the log of the Trade (found with pprint(ib.trades())). I grant that specifying values for both totalQuantity and cashQty seems potentially problematic, but omitting either specification leads to order failure:

  • Omitting totalQuantity=92 above produces the TypeError "TypeError: MarketOrder.__init__() missing 1 required positional argument: 'totalQuantity'".
  • If cashQty=17 is omitted, the order is immediately cancelled with the message='Error 10289, reqId 23964: You must set Cash Quantity for this order' in a TradeLogEntry of the log of the Trade.

What is the appropriate way to specify a cryptocurrency order like the above in ib_async?

UPDATE: When I set totalQuantity=0 and re-place the order, it neither throws an error nor is cancelled, but indefinitely has status='PendingSubmit' in the orderStatus of the Trade object (again per pprint(ib.trades())). I'm still not sure what is going on here. Is totalQuantity=0 just ignored? If so, why isn't the order submitted and filled?

6nc0r6-1mp6r0 avatar Feb 07 '25 01:02 6nc0r6-1mp6r0

I'm seeing the same behavior as the UPDATE. Any resolution?

tlevans avatar May 15 '25 08:05 tlevans