ClosedPositionSubscriptionUpdate

class saxo_openapi.endpoints.portfolio.closedpositions.ClosedPositionSubscriptionUpdate(ContextId, ReferenceId, data)

Extends or reduces the page size, number of positions shown, on a running closed positions subscription. When expanding the page size, the subsequent closed positions are streamed so to avoid race conditions.

ENDPOINT = 'openapi/port/v1/closedpositions/subscriptions/{ContextId}/{ReferenceId}'
EXPECTED_STATUS = 200
METHOD = 'PATCH'
RESPONSE_DATA = None
__init__(ContextId, ReferenceId, data)

Instantiate a ClosedPositionSubscriptionUpdate request.

Parameters:
  • ContextId (string (required)) – the ContextId
  • ReferenceId (string (required)) – the ReferenceId
  • data (dict (required)) – dict representing the parameters of the data body
>>> import saxo_openapi
>>> import saxo_openapi.endpoints.portfolio as pf
>>> import json
>>> client = saxo_openapi.API(access_token=...)
>>> data =
        {
          "NewPageSize": 25630
        }
>>> ContextId = ''
>>> ReferenceId = ''
>>> r = pf.closedpositions.ClosedPositionSubscriptionUpdate(
...                                         ContextId=ContextId,
...                                         ReferenceId=ReferenceId,
...                                         data=data)
>>> client.request(r)
>>> assert r.status_code == r.expected_status

No data is returned.

expected_status
response

response - get the response of the request.

status_code