Skip to content

Commit cecd6d4

Browse files
authored
Merge pull request #35 from h55nick/patch-1
fixes: #34 list_orders takes params
2 parents b870b0a + 756b1e9 commit cecd6d4

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

alpaca_trade_api/rest.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,22 @@ def get_account(self):
130130
resp = self.get('/account')
131131
return Account(resp)
132132

133-
def list_orders(self, status=None):
134-
'''Get a list of orders'''
135-
params = dict()
133+
def list_orders(self, status=None, limit=None, after=None, until=None,
134+
direction=None, params=None):
135+
'''
136+
Get a list of orders
137+
https://docs.alpaca.markets/web-api/orders/#get-a-list-of-orders
138+
'''
139+
if params is None:
140+
params = dict()
141+
if limit is not None:
142+
params['limit'] = limit
143+
if after is not None:
144+
params['after'] = after
145+
if until is not None:
146+
params['until'] = until
147+
if direction is not None:
148+
params['direction'] = direction
136149
if status is not None:
137150
params['status'] = status
138151
resp = self.get('/orders', params)

0 commit comments

Comments
 (0)