Sell Contracts: Multiple Accounts (sell_contract_for_multiple_accounts)

Sell contracts for multiple accounts simultaneously. Uses the shortcode response from buy_contract_for_multiple_accounts to identify the contract, and authorisation tokens to select which accounts to sell those contracts on. Note that only the accounts identified by the tokens will be affected. This will not sell the contract on the currently-authorised account unless you include the token for the current account.

Auth Scope(s): trade

sell_contract_for_multiple_accounts(price: Union[int, float, Decimal], shortcode: str, tokens: List, passthrough: Optional[Any] = None, req_id: Optional[int] = None) → int
Parameters:
  • price (Union[int, float, Decimal]) – Minimum price at which to sell the contract, or 0 for ‘sell at market’.
  • shortcode (str) – An internal ID used to identify the contract which was originally bought. This is returned from the buy and buy_contract_for_multiple_accounts calls.
  • tokens (List) – Authorisation tokens which select the accounts to sell use for the affected accounts.
  • 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_contract_for_multiple_accounts(
    price=500
    shortcode='CALL_R_50_5_1488181433_1488181553_S0P_0'
    tokens=['FrvservuIFEf1', 'JUBibibkebiuwbeCNEc']
)