The module: https://github.com/yanagisawa-kentaro-777/pybitmex/blob/master/pybitmex/bitmex.py
I'm using ws_open_order_objects_of_account()
and with it, I can access:
open_orders = bitmex.ws_open_order_objects_of_account()
for open_bid in open_orders.bids:
print(open_bid.price)
but I want open_bid.orderID
and I've tried open_bid['orderID']
which is not subscriptable. Am I reading the function that it's only returning price?
When you run into a situation like this I recommend you use Python introspection tools such as
dir(open_bid)
andtype(open_bid)
to find out what you're looking at!Based on a quick read of the source code I suspect you're looking at an instance of
so you'll probably want
open_bid.order_id
https://github.com/yanagisawa-kentaro-777/pybitmex/blob/08e6c4e7ae7bbadd5208ec01fd8d361c3a0ce992/pybitmex/models.py#L33
For more info on ways to introspect what is happening in Python: