OrderList¶
-
class
oandapyV20.endpoints.orders.
OrderList
(accountID, params=None)¶ Bases:
oandapyV20.endpoints.orders.Orders
Create an Order for an Account.
-
ENDPOINT
= 'v3/accounts/{accountID}/orders'¶
-
EXPECTED_STATUS
= 200¶
-
METHOD
= 'GET'¶
-
__init__
(accountID, params=None)¶ Instantiate an OrderList request.
Parameters: - accountID (string (required)) – id of the account to perform the request on.
- params (dict) – optional request query parameters, check developer.oanda.com for details
Example:
>>> import oandapyV20 >>> import oandapyV20.endpoints.orders as orders >>> client = oandapyV20.API(access_token=...) >>> r = orders.OrderList(accountID) >>> client.request(r) >>> print r.response
Output:
{ "orders": [ { "partialFill": "DEFAULT_FILL", "price": "1.20000", "stopLossOnFill": { "timeInForce": "GTC", "price": "1.22000" }, "timeInForce": "GTC", "createTime": "2016-10-05T10:25:47.627003645Z", "triggerCondition": "TRIGGER_DEFAULT", "positionFill": "POSITION_DEFAULT", "id": "2125", "instrument": "EUR_USD", "state": "PENDING", "units": "-100", "type": "LIMIT" } ], "lastTransactionID": "2129" }
-