List Orders Maximum or Symbol Support

Running into the limit of 500 orders on list orders.

Some of my buy orders for a Symbol are more than 500 orders behind.

If we could add a Symbol(s) parameter to list orders it would be more useful.

Sometimes I just wanna see ALL orders for a particular symbol, or list of symbols,
no matter how far in history they may be.

Thanks

I am also having this problem. Adding a filter for order status (‘cancelled’ or ‘filled’ etc) would help in my case.

I think list_orders has to have these filters ASAP.

With thanks,
Gil

From what I can tell on the documentation for Orders, at Orders - Documentation | Alpaca, it looks like “get a list of orders” has the parameter for “symbols”. But when checking in the API library, alpaca-trade-api-python/rest.py at master · alpacahq/alpaca-trade-api-python · GitHub, the function “list_orders()” does not have “symbols” as a parameter. For more info, it directs you to the API documentation link above where like I said, “symbols” is a parameter.

Any clarity on this from the Alpaca API team would be great.

Thank you

This is an answer I got from the Community Slack.

The current python SDK alpaca-trade-api-python version 0.53.0 doesn’t directly support the new(ish) symbol parameter. However, there is trick. Well actually not really a trick. Built into the API method is a parameter called params . This is a dictionary of ‘parameter_name:parameter_value’ pairs which are appended to the actual API call. In this case, the API parameter is called symbols . So, to append the symbols parameter do something like this

spy_orders = api.list_orders(params={‘symbols’:‘SPY’})

This actually may be a good place to mention two useful methods get and put . These can be used to send arbitrary API requests. These are useful if a new API call is added or changed but the SDK hasn’t been updated yet. So, another way to list orders would be like this

open_spy_orders = api.get(’/orders’, {‘status’:‘open’, ‘symbols’:‘SPY’})

Simply include the API endpoint, and then a dict of parameter:value pairs for any parameters you want to add for the API.

1 Like