TransactionsSinceID¶
-
class
oandapyV20.endpoints.transactions.
TransactionsSinceID
(accountID, params=None)¶ Bases:
oandapyV20.endpoints.transactions.Transactions
TransactionsSinceID.
Get a range of Transactions for an Account starting at (but not including) a provided Transaction ID.
-
ENDPOINT
= 'v3/accounts/{accountID}/transactions/sinceid'¶
-
EXPECTED_STATUS
= 200¶
-
METHOD
= 'GET'¶
-
__init__
(accountID, params=None)¶ Instantiate an TransactionsSince request.
Parameters: - accountID (string (required)) – id of the account to perform the request on.
- params (dict (required)) – query params to send, check developer.oanda.com for details.
Query Params example:
{ "id": 2306 }
>>> import oandapyV20 >>> import oandapyV20.endpoints.transactions as trans >>> client = oandapyV20.API(access_token=...) >>> params = { "id": 2306 }
>>> r = trans.TransactionsSinceID(accountID=..., params=params) >>> client.request(r) >>> print r.response
Output:
{ "lastTransactionID": "2311", "transactions": [ { "price": "1.25000", "timeInForce": "GTC", "reason": "REPLACEMENT", "clientExtensions": { "comment": "myComment", "id": "myID" }, "id": "2307", "batchID": "2306", "triggerCondition": "TRIGGER_DEFAULT", "replacesOrderID": "2304", "positionFill": "DEFAULT", "userID": 1435156, "instrument": "EUR_USD", "time": "2016-10-25T19:45:38.558056359Z", "units": "-500000", "type": "LIMIT_ORDER", "accountID": "101-004-1435156-001" }, { "orderID": "2307", "clientOrderID": "myID", "reason": "CLIENT_REQUEST", "batchID": "2308", "time": "2016-10-25T20:53:03.789670387Z", "type": "ORDER_CANCEL", "userID": 1435156, "id": "2308", "accountID": "101-004-1435156-001" }, { "price": "1.20000", "stopLossOnFill": { "timeInForce": "GTC", "price": "1.22000" }, "timeInForce": "GTC", "reason": "CLIENT_ORDER", "id": "2309", "batchID": "2309", "triggerCondition": "TRIGGER_DEFAULT", "positionFill": "DEFAULT", "userID": 1435156, "instrument": "EUR_USD", "time": "2016-10-25T21:07:21.065554321Z", "units": "-100", "type": "LIMIT_ORDER", "accountID": "101-004-1435156-001" }, { "userID": 1435156, "marginRate": "0.01", "batchID": "2310", "time": "2016-10-26T13:28:00.507651360Z", "type": "CLIENT_CONFIGURE", "id": "2310", "accountID": "101-004-1435156-001" }, { "userID": 1435156, "marginRate": "0.01", "batchID": "2311", "time": "2016-10-26T13:28:13.597103123Z", "type": "CLIENT_CONFIGURE", "id": "2311", "accountID": "101-004-1435156-001" } ] }
-