ExerciseAmount

class saxo_openapi.endpoints.trading.positions.ExerciseAmount(data)

Forces exercise of an amount across all positions for the specified UIC. This is relevant for Futures Options, Stock Options, Stock Index Options.

ENDPOINT = 'openapi/trade/v1/positions/exercise'
EXPECTED_STATUS = 204
METHOD = 'PUT'
__init__(data)

Instantiate an ExerciseAmount request.

Parameters: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==",
          "Amount": 100,
          "AssetType": "StockOption",
          "Uic": 5455848
        }
>>> r = tr.positions.ExerciseAmount(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