This code:
open_trades = ib.trades() #Interactive Brokers function
for i in range(0,len(open_trades)):
print(open_trades[i].orderStatus
prints OrderStatus(status='Submitted', remaining=1000.0, permId=1036207528, clientId=1)
Now how do I get the permID?
The answer should look something like this (I tried many other things too):
open_trades[i].orderStatus.permID #no attribute error
open_trades[i].orderStatus.OrderStatus.permID #no attribute error
open_trades[i].orderStatus[0].permID #gets error 'OrderStatus' object does not support indexing
The last attempt is most likely the closest answer which gets the error:
'OrderStatus' object does not support indexing