UpdatePosition¶
-
class
saxo_openapi.endpoints.trading.positions.
UpdatePosition
(PositionId, data)¶ Updates properties of an existing position. This is only relevant for FX Options, where you can update the Exercise method.
-
ENDPOINT
= 'openapi/trade/v1/positions/{PositionId}'¶
-
EXPECTED_STATUS
= 204¶
-
METHOD
= 'PATCH'¶
-
__init__
(PositionId, data)¶ Instantiate an UpdatePosition request.
Parameters: - PositionId (string (required)) – the position id
- data (dict (required)) – dict representing the data body.
>>> import saxo_openapi >>> import saxo_openapi.endpoints.trading as tr >>> import json >>> client = saxo_openapi.API(access_token=...) >>> data = { "AccountKey": "LZTc7DdejXODf-WSl2aCyQ==", "ExerciseMethod": "Spot" }
>>> PositionId = 1019942425 >>> r = tr.positions.UpdatePosition(PositionId, data=data) >>> rv = client.request(r) >>> print(json.dumps(rv, indent=2))
{ "PositionId": "1019942426" }
-
expected_status
¶
-
response
¶ response - get the response of the request.
-
status_code
¶
-