GetOpenOrdersMe

class saxo_openapi.endpoints.portfolio.orders.GetOpenOrdersMe(params=None)

get all the open orders on a client to which the logged in user belongs.

ENDPOINT = 'openapi/port/v1/orders/me/'
EXPECTED_STATUS = 200
METHOD = 'GET'
__init__(params=None)

Instantiate a GetOpenOrdersMe request.

Parameters:params (dict (optional)) – dict representing the querystring parameters
>>> import saxo_openapi
>>> import saxo_openapi.endpoints.portfolio as pf
>>> import json
>>> client = saxo_openapi.API(access_token=...)
>>> params =
        {}
>>> r = pf.orders.GetOpenOrdersMe(params=params)
>>> client.request(r)
>>> print(json.dumps(r.response, indent=2))

Output:

{
  "__count": 3,
  "Data": [
    {
      "AccountId": "9226397",
      "AccountKey": "Cf4xZWiYL6W1nMKpygBLLA==",
      "Amount": 100000,
      "AssetType": "FxSpot",
      "BuySell": "Buy",
      "CalculationReliability": "Ok",
      "ClientKey": "Cf4xZWiYL6W1nMKpygBLLA==",
      "CorrelationKey": "925ab7aa-998b-4f4b-af26-7c1b3f4eee27",
      "CurrentPrice": 7.46175,
      "CurrentPriceDelayMinutes": 0,
      "CurrentPriceType": "Ask",
      "DistanceToMarket": 0.46175,
      "Duration": {
        "DurationType": "GoodTillCancel"
      },
      "IsMarketOpen": true,
      "MarketPrice": 7.46175,
      "OpenOrderType": "Limit",
      "OrderAmountType": "Quantity",
      "OrderId": "76332324",
      "OrderRelation": "StandAlone",
      "OrderTime": "2019-03-07T14:54:17.423333Z",
      "Price": 7,
      "RelatedOpenOrders": [],
      "Status": "Working",
      "Uic": 16
    },
    {
      "AccountId": "9226397",
      "AccountKey": "Cf4xZWiYL6W1nMKpygBLLA==",
      "Amount": 100000,
      "AssetType": "FxSpot",
      "BuySell": "Buy",
      "CalculationReliability": "Ok",
      "ClientKey": "Cf4xZWiYL6W1nMKpygBLLA==",
      "CorrelationKey": "e684a2e2-f9f9-4b10-91ad-a50e2f8b80ae",
      "CurrentPrice": 7.46175,
      "CurrentPriceDelayMinutes": 0,
      "CurrentPriceType": "Ask",
      "DistanceToMarket": 0.46175,
      "Duration": {
        "DurationType": "GoodTillCancel"
      },
      "IsMarketOpen": true,
      "MarketPrice": 7.46175,
      "OpenOrderType": "Limit",
      "OrderAmountType": "Quantity",
      "OrderId": "76328908",
      "OrderRelation": "StandAlone",
      "OrderTime": "2019-03-07T12:04:13.493333Z",
      "Price": 7,
      "RelatedOpenOrders": [],
      "Status": "Working",
      "Uic": 16
    },
    {
      "AccountId": "9226397",
      "AccountKey": "Cf4xZWiYL6W1nMKpygBLLA==",
      "Amount": 10000,
      "AssetType": "FxSpot",
      "BuySell": "Buy",
      "CalculationReliability": "Ok",
      "ClientKey": "Cf4xZWiYL6W1nMKpygBLLA==",
      "CorrelationKey": "ec6ca0f4-8380-4068-a32d-538b7b06208e",
      "CurrentPrice": 1.30195,
      "CurrentPriceDelayMinutes": 0,
      "CurrentPriceType": "Ask",
      "DistanceToMarket": 0.20195,
      "Duration": {
        "DurationType": "GoodTillCancel"
      },
      "IsMarketOpen": true,
      "MarketPrice": 1.30195,
      "OpenOrderType": "Limit",
      "OrderAmountType": "Quantity",
      "OrderId": "76289260",
      "OrderRelation": "StandAlone",
      "OrderTime": "2019-03-04T17:55:59.503333Z",
      "Price": 1.1,
      "RelatedOpenOrders": [],
      "Status": "Working",
      "Uic": 31
    }
  ]
}
expected_status
response

response - get the response of the request.

status_code