Skip to main content

IqOptionBroker

Struct IqOptionBroker 

Source
pub struct IqOptionBroker { /* private fields */ }
Expand description

Adaptador IQ Option.

Implementations§

Source§

impl IqOptionBroker

Source

pub async fn get_technical_indicators( &self, symbol: &str, ) -> Result<TechnicalIndicators, BrokerError>

Source

pub async fn get_asset_profile( &self, symbol: &str, ) -> Result<AssetProfile, BrokerError>

Source

pub async fn subscribe_live_deals( &self, symbol: &str, ) -> Result<(), BrokerError>

Source

pub async fn subscribe_commission_changes(&self) -> Result<(), BrokerError>

Source

pub async fn buy_blitz( &self, req: BuyBlitzRequest, ) -> Result<OrderId, BrokerError>

Source

pub async fn buy_digital_spot( &self, req: BuyDigitalRequest, ) -> Result<OrderId, BrokerError>

Source§

impl IqOptionBroker

Source

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

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,

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,

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 name(&self) -> &'static str

Nombre estable del adaptador, p. ej. iq_option.
Source§

fn connect<'async_trait>( params: BrokerParams, ) -> Pin<Box<dyn Future<Output = Result<Self, BrokerError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Constructor de la sesión: autentica y deja el bróker operativo.
Source§

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,

Source§

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,

Metadatos de la sesión activa (copia: la sesión se actualiza en caliente).
Source§

fn iqoption_extras(&self) -> Option<&dyn IqOptionExtras>

Acceso a las capacidades exclusivas de IQ Option, si el adaptador las ofrece. Los adaptadores que no las implementan devuelven None.
Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Payout publicado en el catálogo para el activo. Read more
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,

Venta anticipada (buyback) de una orden abierta. El bróker la admite dentro de la ventana 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,

Historial de posiciones cerradas (cartera): para analítica de cuenta. 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,

Compra clásica (turbo o binary según la duración). Read more
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,

Stream de eventos (cierres, balances, payouts en vivo, velas suscritas).
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,

Suscribe el stream nativo de ticks de un activo. Read more
Source§

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,

Indicadores técnicos que el bróker envía para un activo.
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,

Perfil fundamental del activo (nombre, ticker y variaciones).
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,

Stream de operaciones de terceros (live-deal).
Source§

fn subscribe_commission_changes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), BrokerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cambios de comisión por tipo de instrumento.
Source§

fn buy_blitz<'life0, 'async_trait>( &'life0 self, req: BuyBlitzRequest, ) -> Pin<Box<dyn Future<Output = Result<OrderId, BrokerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Compra BLITZ (duración en segundos y payout explícito).
Source§

fn buy_digital_spot<'life0, 'async_trait>( &'life0 self, req: BuyDigitalRequest, ) -> Pin<Box<dyn Future<Output = Result<OrderId, BrokerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Compra digital por strike elegido.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more