pub struct DerivBroker { /* private fields */ }Expand description
Adaptador Deriv.
Implementations§
Source§impl DerivBroker
impl DerivBroker
Sourcepub async fn nuevo(config: DerivConfig) -> Result<Self, BrokerError>
pub async fn nuevo(config: DerivConfig) -> Result<Self, BrokerError>
Construye el adaptador y espera la primera conexión.
Sourcepub fn config(&self) -> &DerivConfig
pub fn config(&self) -> &DerivConfig
Configuración efectiva.
Sourcepub fn es_publico(&self) -> bool
pub fn es_publico(&self) -> bool
¿Es una sesión sin credenciales?
Trait Implementations§
Source§impl Broker for DerivBroker
impl Broker for DerivBroker
Source§fn connect<'async_trait>(
params: BrokerParams,
) -> Pin<Box<dyn Future<Output = Result<Self, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn connect<'async_trait>(
params: BrokerParams,
) -> Pin<Box<dyn Future<Output = Result<Self, BrokerError>> + Send + 'async_trait>>where
Self: 'async_trait,
Constructor de la sesión: autentica y deja el bróker operativo.
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,
Metadatos de la sesión activa (copia: la sesión se actualiza en caliente).
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 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,
Suscribe el stream nativo de ticks de un activo. Read more
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,
Historial de posiciones cerradas (cartera): para analítica de cuenta.
limit ≤ 100 por página, offset para paginar.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,
Payout publicado en el catálogo para el activo. Read more
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 por expiración y tipo de opción. Read more
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,
Compra clásica (turbo o binary según la duración). 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,
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_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,
Resultado leído de la caché local (alimentada por
events()). Read moreSource§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,
Stream de eventos (cierres, balances, payouts en vivo, velas suscritas).
Source§fn iqoption_extras(&self) -> Option<&dyn IqOptionExtras>
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.Auto Trait Implementations§
impl !RefUnwindSafe for DerivBroker
impl !UnwindSafe for DerivBroker
impl Forget for DerivBroker
impl Freeze for DerivBroker
impl Send for DerivBroker
impl Sync for DerivBroker
impl Unpin for DerivBroker
impl UnsafeUnpin for DerivBroker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more