Skip to content

Commit 756b1e9

Browse files
authored
update list_orders method to be explicit. #pr-comments
1 parent fc17868 commit 756b1e9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

alpaca_trade_api/rest.py

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

133-
def list_orders(self, params=dict(), status=None):
133+
def list_orders(self, status=None, limit=None, after=None, until=None,
134+
direction=None, params=None):
134135
'''
135136
Get a list of orders
136137
https://docs.alpaca.markets/web-api/orders/#get-a-list-of-orders
137138
'''
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
138149
if status is not None:
139150
params['status'] = status
140151
resp = self.get('/orders', params)

0 commit comments

Comments
 (0)