PositionByQuote¶
-
class
saxo_openapi.endpoints.trading.positions.
PositionByQuote
(data)¶ Creates a new position by accepting a quote.
The quote must be the most recent one and it must be tradable: (Quote.PriceType=PriceType.Tradable).
-
ENDPOINT
= 'openapi/trade/v1/positions'¶
-
EXPECTED_STATUS
= 201¶
-
METHOD
= 'POST'¶
-
__init__
(data)¶ Instantiate a PositionByQuote 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 = { "AppHint": 12, "BuySell": "Buy", "PriceReferenceId": "P57629", "QuoteId": "1232145", "UserPrice": 234.1 }
>>> r = tr.positions.PositionByQuote(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
¶
-