derivitec.core.client.DerivitecClient.position_upload¶
- DerivitecClient.position_upload(positions)[source]¶
Position upload.
- Parameters:
positions (list of Position)
- Return type:
derivitec.positions.types.ApiPositionUploadResponse
What follows is an example of booking a new bond future. See
derivitec.positions.position.Positionfor more information about the Position class.Code
>>> import uuid >>> contract = BondFutureByCode(code=ric("FVZ8")) >>> book = "Book 1" >>> position = Position( ... book=book, ... trade_action="NEW", ... quantity=1, ... trade_date = datetime(2017, 12, 7), ... contract = contract, ... client_transaction_id = str(uuid.uuid4()))) >>> positions = [position] >>> response = client.position_upload(position)
We can check the status of the request
>>> response.IsSuccess True
response.Results has a list of
derivitec.positions.types.PositionUploadResultwith additional information of each attempted upload.