Price Proposal (proposal)

Gets latest price for a specific contract.

proposal(contract_type: str, currency: str, symbol: str, amount: Optional[Union[int, float, Decimal]] = None, barrier: Optional[str] = None, barrier2: Optional[str] = None, barrier_range: Optional[str] = None, basis: Optional[str] = None, cancellation: Optional[str] = None, date_expiry: Optional[int] = None, date_start: Optional[int] = None, duration: Optional[int] = None, duration_unit: Optional[str] = None, limit_order=None, multiplier: Optional[Union[int, float, Decimal]] = None, product_type: Optional[str] = None, selected_tick: Optional[int] = None, subscribe: Optional[Union[bool, int]] = None, trading_period_start: Optional[int] = None, passthrough: Optional[Any] = None, req_id: Optional[int] = None) → int
Parameters:
  • contract_type (str) – The proposed contract type
  • currency (str) – This can only be the account-holder’s currency (obtained from payout_currencies call).
  • symbol (str) – The short symbol name (obtained from active_symbols call).
  • amount (Optional[Union[int, float, Decimal]]) – [Optional] Proposed contract payout or stake, or multiplier (for lookbacks).
  • barrier (Optional[str]) – [Optional] Barrier for the contract (or last digit prediction for digit contracts). Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-), where entry spot would be adjusted accordingly with that amount to define a barrier, except for Synthetic Indices as they support both relative and absolute barriers. Not needed for lookbacks.
  • barrier2 (Optional[str]) – [Optional] Low barrier for the contract (for contracts with two barriers). Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-), where entry spot would be adjusted accordingly with that amount to define a barrier, except for Synthetic Indices as they support both relative and absolute barriers. Not needed for lookbacks.
  • barrier_range (Optional[str]) – [Optional] Barrier range for callputspread.
  • basis (Optional[str]) – [Optional] Indicates type of the amount.
  • cancellation (Optional[str]) – Cancellation duration option (only for MULTUP and MULTDOWN contracts).
  • date_expiry (Optional[int]) – [Optional] Epoch value of the expiry time of the contract. Either date_expiry or duration is required.
  • date_start (Optional[int]) – [Optional] Indicates epoch value of the starting time of the contract. If left empty, the start time of the contract is now.
  • duration (Optional[int]) – [Optional] Duration quantity. Either date_expiry or duration is required.
  • duration_unit (Optional[str]) – [Optional] Duration unit - s: seconds, m: minutes, h: hours, d: days, t: ticks.
  • limit_order – Add an order to close the contract once the order condition is met (only for MULTUP and MULTDOWN contracts). Supported orders: take_profit, stop_loss.
  • multiplier (Optional[Union[int, float, Decimal]]) – [Optional] The multiplier for non-binary options. E.g. lookbacks.
  • product_type (Optional[str]) – [Optional] The product type.
  • selected_tick (Optional[int]) – [Optional] The tick that is predicted to have the highest/lowest value - for TICKHIGH and TICKLOW contracts.
  • subscribe (Optional[Union[bool, int]]) – [Optional] 1 - to initiate a realtime stream of prices. Note that tick trades (without a user-defined barrier), digit trades and less than 24 hours at-the-money contracts for the following underlying symbols are not streamed: R_10, R_25, R_50, R_75, R_100, RDBULL, RDBEAR (this is because their price is constant).
  • trading_period_start (Optional[int]) – [Optional] Required only for multi-barrier trading. Defines the epoch value of the trading period start time.
  • 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.proposal(
    amount=100
    barrier='+0.1'
    basis='payout'
    contract_type='CALL'
    currency='USD'
    duration=60
    duration_unit='s'
    symbol='R_100'
)