ChangeOrder¶
-
class
saxo_openapi.endpoints.trading.orders.
ChangeOrder
(data)¶ Change one or more existing orders.
-
ENDPOINT
= 'openapi/trade/v2/orders'¶
-
EXPECTED_STATUS
= 200¶
-
METHOD
= 'PATCH'¶
-
__init__
(data)¶ Instantiate a ChangeOrder request.
Parameters: data (dict (required)) – dict representing the data body, in this case an order change spec. OrderBody example:
data = { "AccountKey": "Cf4xZWiYL6W1nMKpygBLLA==", "Amount": 40000.0, "AssetType": "FxSpot", "OrderId": "76289286", "OrderType": "Limit", "ManualOrder": false, "OrderDuration": { "DurationType": "DayOrder" } }
>>> import saxo_openapi >>> import saxo_openapi.endpoints.trading as tr >>> import json >>> client = saxo_openapi.API(access_token=...) >>> data = ... >>> r = tr.orders.ChangeOrder(data=data) >>> client.request(r) >>> print(json.dumps(r.response, indent=4))
Output:
{ "OrderId": "76289286" }
-
expected_status
¶
-
response
¶ response - get the response of the request.
-
status_code
¶
-