InfoPrice

class saxo_openapi.endpoints.trading.infoprices.InfoPrice(params)

Gets an info price for an instrument using the specified parameters.

ENDPOINT = 'openapi/trade/v1/infoprices'
EXPECTED_STATUS = 200
METHOD = 'GET'
__init__(params)

Instantiate an InfoPrice request.

Parameters:params (dict (required)) – dict representing the querystring parameters.
>>> import saxo_openapi
>>> import saxo_openapi.endpoints.trading as tr
>>> import json
>>> client = saxo_openapi.API(access_token=...)
>>> params =
        {
          "Uic": 22,
          "AccountKey": "81ef1924-c25f-43fe-90ff-028e3fe249f2",
          "AssetType": "...",
          "<other-parms>": "..."
        }
>>> r = tr.infoprices.InfoPrice(params=params)
>>> client.request(r)
>>> print(json.dumps(r.response, indent=4))

Output:

{
  "AssetType": "FxSpot",
  "DisplayAndFormat": {
    "Currency": "AUD",
    "Decimals": 4,
    "Description": "British Pound/Australian Dollar",
    "Format": "AllowDecimalPips",
    "OrderDecimals": 4,
    "Symbol": "GBPAUD"
  },
  "HistoricalChanges": {
    "PercentChange1Month": 1.21,
    "PercentChange2Months": 2.95,
    "PercentChange3Months": 1.85,
    "PercentChange6Months": -1.83,
    "PercentChangeWeekly": 1.67
  },
  "InstrumentPriceDetails": {
    "IsMarketOpen": true,
    "ShortTradeDisabled": false,
    "ValueDate": "2017-05-19"
  },
  "LastUpdated": "0001-01-01T00:00:00Z",
  "PriceInfo": {
    "High": 1.09117,
    "Low": 1.08853,
    "NetChange": 0.00048,
    "PercentChange": 0.04
  },
  "PriceInfoDetails": {
    "AskSize": 1000000.0,
    "BidSize": 1000000.0,
    "LastClose": 1.08932,
    "LastTraded": 0.0,
    "LastTradedSize": 0.0,
    "Open": 0.0,
    "Volume": 0.0
  },
  "Quote": {
    "Amount": 100000,
    "Ask": 1.74948,
    "Bid": 1.74858,
    "DelayedByMinutes": 15,
    "ErrorCode": "None",
    "Mid": 1.74903,
    "PriceTypeAsk": "Indicative",
    "PriceTypeBid": "Indicative"
  },
  "Uic": 22
}
expected_status
response

response - get the response of the request.

status_code