TradeDetails

class oandapyV20.endpoints.trades.TradeDetails(accountID, tradeID)

Bases: oandapyV20.endpoints.trades.Trades

Get the details of a specific Trade in an Account.

ENDPOINT = 'v3/accounts/{accountID}/trades/{tradeID}'
EXPECTED_STATUS = 200
METHOD = 'GET'
__init__(accountID, tradeID)

Instantiate a TradeDetails request.

Parameters:
  • accountID (string (required)) – id of the account to perform the request on.
  • tradeID (string (required)) – id of the trade.
>>> import oandapyV20
>>> import oandapyV20.endpoints.trades as trades
>>> client = oandapyV20.API(access_token=...)
>>> r = accounts.TradeDetails(accountID=..., tradeID=...)
>>> client.request(r)
>>> print r.response

Output:

{
  "lastTransactionID": "2317",
  "trade": {
    "instrument": "DE30_EUR",
    "financing": "0.0000",
    "openTime": "2016-10-28T14:28:05.231759081Z",
    "initialUnits": "10",
    "currentUnits": "10",
    "price": "10678.3",
    "unrealizedPL": "226.0000",
    "realizedPL": "0.0000",
    "state": "OPEN",
    "id": "2315"
  }
}