GetOpenOrder¶
-
class
saxo_openapi.endpoints.portfolio.orders.
GetOpenOrder
(ClientKey, OrderId, params=None)¶ get a specific open order of a client. Unique id of the client.Unique id of the order.Specification of field groups to return. Default is empty.
-
ENDPOINT
= 'openapi/port/v1/orders/{ClientKey}/{OrderId}'¶
-
EXPECTED_STATUS
= 200¶
-
METHOD
= 'GET'¶
-
__init__
(ClientKey, OrderId, params=None)¶ Instantiate a GetOpenOrder request.
Parameters: - ClientKey (string (required)) – the ClientKey
- OrderId (string (required)) – the OrderId
>>> import saxo_openapi >>> import saxo_openapi.endpoints.portfolio as pf >>> import json >>> client = saxo_openapi.API(access_token=...) >>> ClientKey = 'Cf4xZWiYL6W1nMKpygBLLA==' >>> OrderId = '76332324' >>> params = {}
>>> r = pf.orders.GetOpenOrder(ClientKey=ClientKey, ... OrderId=OrderId, ... params=params) >>> client.request(r) >>> print(json.dumps(r.response, indent=2))
Output:
{ "__count": 1, "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 } ] }
-
expected_status
¶
-
response
¶ response - get the response of the request.
-
status_code
¶
-