Number of open orders?

check_orders = api.list_orders(status=‘open’)

Will return list of open orders as well as info about them. However I wish to have a int that could tell me simply the number of open orders rather then getting a huge list… but I can’t seem to figure that out.

just use len on the result:

num_of_open_orders = len(api.list_orders(status='open'))

Thank you so much, works just as wanted!

1 Like