Sell Contract (sell)

Sell a Contract as identified from a previous portfolio call.

Auth Scope(s): trade

sell(sell: int, price: Union[int, float, Decimal], passthrough: Optional[Any] = None, req_id: Optional[int] = None) → int
Parameters:
  • sell (int) – Pass contract_id received from the portfolio call.
  • price (Union[int, float, Decimal]) – Minimum price at which to sell the contract, or 0 for ‘sell at market’.
  • passthrough (Optional[Any]) – [Optional] Used to pass data through the websocket, which may be retrieved via the echo_req output field.
  • req_id (Optional[int]) – [Optional] Used to map request to response.
Returns:

req_id

Return type:

int

Example

binary.api.sell(
    11542203588
    price=500
)