pub struct IqOptionBroker { /* private fields */ }Expand description
Adaptador IQ Option.
Implementations§
Source§impl IqOptionBroker
impl IqOptionBroker
pub async fn get_technical_indicators( &self, symbol: &str, ) -> Result<TechnicalIndicators, BrokerError>
pub async fn get_asset_profile( &self, symbol: &str, ) -> Result<AssetProfile, BrokerError>
pub async fn subscribe_live_deals( &self, symbol: &str, ) -> Result<(), BrokerError>
pub async fn subscribe_commission_changes(&self) -> Result<(), BrokerError>
pub async fn buy_blitz( &self, req: BuyBlitzRequest, ) -> Result<OrderId, BrokerError>
pub async fn buy_digital_spot( &self, req: BuyDigitalRequest, ) -> Result<OrderId, BrokerError>
Source§impl IqOptionBroker
impl IqOptionBroker
Sourcepub async fn nuevo(params: BrokerParams) -> Result<Self, BrokerError>
pub async fn nuevo(params: BrokerParams) -> Result<Self, BrokerError>
Constructor de la sesión: login, WSS, ssid, perfil y catálogo.
Trait Implementations§
Source§impl Broker for IqOptionBroker
impl Broker for IqOptionBroker
Source§fn quote_payout<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
option_type: OptionType,
expiration_seconds: u64,
amount: f64,
) -> Pin<Box<dyn Future<Output = Result<PayoutQuote, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn quote_payout<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
option_type: OptionType,
expiration_seconds: u64,
amount: f64,
) -> Pin<Box<dyn Future<Output = Result<PayoutQuote, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Cotización viva por expiración y tipo de opción.
IQ Option publica el payout digital en
price-splitter.client-price-generated: la entrada SPT es el spot y
call.bid el precio con el que se calcula el payout de CALL. El canal
se verificó en vivo con la cuenta; no hubo frames equivalentes para
instrument-quotes-generated (binary/turbo/blitz). Por eso esos tipos
devuelven available: false en vez de reutilizar el payout del
catálogo, que no es una cotización por expiración.
Source§fn get_operation_result<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 OrderId,
) -> Pin<Box<dyn Future<Output = Result<OperationResult, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_operation_result<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 OrderId,
) -> Pin<Box<dyn Future<Output = Result<OperationResult, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lee el resultado de la caché local, alimentada por los eventos de
cierre (option-closed, socket-option-closed, position-changed).
No hace ninguna petición al bróker: si el cierre aún no ha llegado
por eventos, devuelve OperationResult::Pending.
Source§fn connect<'async_trait>(
params: BrokerParams,
) -> Pin<Box<dyn Future<Output = Result<Self, BrokerError>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
fn connect<'async_trait>(
params: BrokerParams,
) -> Pin<Box<dyn Future<Output = Result<Self, BrokerError>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn session<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Session, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn session<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Session, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn iqoption_extras(&self) -> Option<&dyn IqOptionExtras>
fn iqoption_extras(&self) -> Option<&dyn IqOptionExtras>
None.fn get_balance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_type<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AccountType, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn switch_account<'life0, 'async_trait>(
&'life0 mut self,
kind: AccountType,
) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_assets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Asset>, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn asset_status<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MarketStatus, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_candles<'life0, 'async_trait>(
&'life0 self,
req: CandleRequest,
) -> Pin<Box<dyn Future<Output = Result<Vec<Candle>, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_candles<'life0, 'async_trait>(
&'life0 self,
req: CandleSubscribe,
) -> Pin<Box<dyn Future<Output = Result<CandleStream, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_payout<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
expiration_seconds: u64,
) -> Pin<Box<dyn Future<Output = Result<Payout, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_payout<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
expiration_seconds: u64,
) -> Pin<Box<dyn Future<Output = Result<Payout, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn sell_option<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 OrderId,
) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sell_option<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 OrderId,
) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
buyback_deadtime del activo; si la orden ya no
es vendible responde con su mensaje de rechazo.Source§fn get_position_history<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: Option<&'life1 str>,
limit: usize,
offset: usize,
) -> Pin<Box<dyn Future<Output = Result<PositionHistory, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_position_history<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: Option<&'life1 str>,
limit: usize,
offset: usize,
) -> Pin<Box<dyn Future<Output = Result<PositionHistory, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
limit ≤ 100 por página, offset para paginar.Source§fn buy_binary<'life0, 'async_trait>(
&'life0 self,
req: BuyBinaryRequest,
) -> Pin<Box<dyn Future<Output = Result<OrderId, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn buy_binary<'life0, 'async_trait>(
&'life0 self,
req: BuyBinaryRequest,
) -> Pin<Box<dyn Future<Output = Result<OrderId, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<EventStream, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn events<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<EventStream, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn subscribe_ticks<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe_ticks<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl IqOptionExtras for IqOptionBroker
impl IqOptionExtras for IqOptionBroker
Source§fn get_technical_indicators<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TechnicalIndicators, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_technical_indicators<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TechnicalIndicators, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_asset_profile<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AssetProfile, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_asset_profile<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AssetProfile, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn subscribe_live_deals<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe_live_deals<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
live-deal).