pub struct InteractiveBrokersDataClient { /* private fields */ }Expand description
Interactive Brokers data client.
This client provides market data functionality using the rust-ibapi library.
It manages subscriptions, handles historical data requests, and streams
market data to NautilusTrader.
Implementations§
Source§impl InteractiveBrokersDataClient
impl InteractiveBrokersDataClient
Sourcepub fn new(
client_id: ClientId,
config: InteractiveBrokersDataClientConfig,
instrument_provider: Arc<InteractiveBrokersInstrumentProvider>,
) -> Result<Self>
pub fn new( client_id: ClientId, config: InteractiveBrokersDataClientConfig, instrument_provider: Arc<InteractiveBrokersInstrumentProvider>, ) -> Result<Self>
Sourcepub async fn batch_load_instruments(
&self,
instrument_ids: Vec<InstrumentId>,
) -> Result<Vec<InstrumentId>>
pub async fn batch_load_instruments( &self, instrument_ids: Vec<InstrumentId>, ) -> Result<Vec<InstrumentId>>
Batch load multiple instrument IDs using the internal IB client.
This method calls the provider’s batch_load with the data client’s IB client.
§Errors
Returns an error if:
- The client is not connected.
- The provider batch_load fails.
Sourcepub async fn fetch_option_chain_by_range(
&self,
underlying_symbol: &str,
exchange: Option<&str>,
currency: Option<&str>,
expiry_min: Option<&str>,
expiry_max: Option<&str>,
) -> Result<usize>
pub async fn fetch_option_chain_by_range( &self, underlying_symbol: &str, exchange: Option<&str>, currency: Option<&str>, expiry_min: Option<&str>, expiry_max: Option<&str>, ) -> Result<usize>
Fetch option chain for an underlying contract with expiry filtering.
This method calls the provider’s fetch_option_chain_by_range with the data client’s IB client.
§Errors
Returns an error if:
- The client is not connected.
- The provider method fails.
Sourcepub async fn fetch_futures_chain(
&self,
symbol: &str,
exchange: Option<&str>,
currency: Option<&str>,
min_expiry_days: Option<u32>,
max_expiry_days: Option<u32>,
) -> Result<usize>
pub async fn fetch_futures_chain( &self, symbol: &str, exchange: Option<&str>, currency: Option<&str>, min_expiry_days: Option<u32>, max_expiry_days: Option<u32>, ) -> Result<usize>
Fetch futures chain for a given underlying symbol.
This method calls the provider’s fetch_futures_chain with the data client’s IB client.
§Errors
Returns an error if:
- The client is not connected.
- The provider method fails.
Sourcepub async fn fetch_bag_contract(&self, bag_contract: &Contract) -> Result<usize>
pub async fn fetch_bag_contract(&self, bag_contract: &Contract) -> Result<usize>
Fetch BAG (spread) contract details.
This method calls the provider’s fetch_bag_contract with the data client’s IB client.
§Errors
Returns an error if:
- The client is not connected.
- The provider method fails.
Trait Implementations§
Source§impl DataClient for InteractiveBrokersDataClient
impl DataClient for InteractiveBrokersDataClient
Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
true if the client is currently connected.Source§fn is_disconnected(&self) -> bool
fn is_disconnected(&self) -> bool
true if the client is currently disconnected.Source§fn subscribe_quotes(&mut self, cmd: SubscribeQuotes) -> Result<()>
fn subscribe_quotes(&mut self, cmd: SubscribeQuotes) -> Result<()>
Source§fn subscribe_index_prices(&mut self, cmd: SubscribeIndexPrices) -> Result<()>
fn subscribe_index_prices(&mut self, cmd: SubscribeIndexPrices) -> Result<()>
Source§fn subscribe_option_greeks(&mut self, cmd: SubscribeOptionGreeks) -> Result<()>
fn subscribe_option_greeks(&mut self, cmd: SubscribeOptionGreeks) -> Result<()>
Source§fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> Result<()>
fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> Result<()>
Source§fn unsubscribe_index_prices(
&mut self,
cmd: &UnsubscribeIndexPrices,
) -> Result<()>
fn unsubscribe_index_prices( &mut self, cmd: &UnsubscribeIndexPrices, ) -> Result<()>
Source§fn unsubscribe_option_greeks(
&mut self,
cmd: &UnsubscribeOptionGreeks,
) -> Result<()>
fn unsubscribe_option_greeks( &mut self, cmd: &UnsubscribeOptionGreeks, ) -> Result<()>
Source§fn subscribe_trades(&mut self, cmd: SubscribeTrades) -> Result<()>
fn subscribe_trades(&mut self, cmd: SubscribeTrades) -> Result<()>
Source§fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> Result<()>
fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> Result<()>
Source§fn subscribe_bars(&mut self, cmd: SubscribeBars) -> Result<()>
fn subscribe_bars(&mut self, cmd: SubscribeBars) -> Result<()>
Source§fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> Result<()>
fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> Result<()>
Source§fn subscribe_book_deltas(&mut self, cmd: SubscribeBookDeltas) -> Result<()>
fn subscribe_book_deltas(&mut self, cmd: SubscribeBookDeltas) -> Result<()>
Source§fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> Result<()>
fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> Result<()>
Source§fn request_instrument(&self, cmd: RequestInstrument) -> Result<()>
fn request_instrument(&self, cmd: RequestInstrument) -> Result<()>
Source§fn request_instruments(&self, cmd: RequestInstruments) -> Result<()>
fn request_instruments(&self, cmd: RequestInstruments) -> Result<()>
Source§fn request_quotes(&self, cmd: RequestQuotes) -> Result<()>
fn request_quotes(&self, cmd: RequestQuotes) -> Result<()>
Source§fn request_trades(&self, cmd: RequestTrades) -> Result<()>
fn request_trades(&self, cmd: RequestTrades) -> Result<()>
Source§fn request_bars(&self, cmd: RequestBars) -> Result<()>
fn request_bars(&self, cmd: RequestBars) -> Result<()>
§fn subscribe(&mut self, cmd: SubscribeCustomData) -> Result<(), Error>
fn subscribe(&mut self, cmd: SubscribeCustomData) -> Result<(), Error>
§fn subscribe_instruments(
&mut self,
cmd: SubscribeInstruments,
) -> Result<(), Error>
fn subscribe_instruments( &mut self, cmd: SubscribeInstruments, ) -> Result<(), Error>
§fn subscribe_instrument(
&mut self,
cmd: SubscribeInstrument,
) -> Result<(), Error>
fn subscribe_instrument( &mut self, cmd: SubscribeInstrument, ) -> Result<(), Error>
§fn subscribe_book_depth(&mut self, cmd: SubscribeBookDepth) -> Result<(), Error>
fn subscribe_book_depth(&mut self, cmd: SubscribeBookDepth) -> Result<(), Error>
§fn subscribe_mark_prices(
&mut self,
cmd: SubscribeMarkPrices,
) -> Result<(), Error>
fn subscribe_mark_prices( &mut self, cmd: SubscribeMarkPrices, ) -> Result<(), Error>
§fn subscribe_funding_rates(
&mut self,
cmd: SubscribeFundingRates,
) -> Result<(), Error>
fn subscribe_funding_rates( &mut self, cmd: SubscribeFundingRates, ) -> Result<(), Error>
§fn subscribe_instrument_status(
&mut self,
cmd: SubscribeInstrumentStatus,
) -> Result<(), Error>
fn subscribe_instrument_status( &mut self, cmd: SubscribeInstrumentStatus, ) -> Result<(), Error>
§fn subscribe_instrument_close(
&mut self,
cmd: SubscribeInstrumentClose,
) -> Result<(), Error>
fn subscribe_instrument_close( &mut self, cmd: SubscribeInstrumentClose, ) -> Result<(), Error>
§fn subscribe_blocks(&mut self, cmd: SubscribeBlocks) -> Result<(), Error>
fn subscribe_blocks(&mut self, cmd: SubscribeBlocks) -> Result<(), Error>
§fn subscribe_pool(&mut self, cmd: SubscribePool) -> Result<(), Error>
fn subscribe_pool(&mut self, cmd: SubscribePool) -> Result<(), Error>
§fn subscribe_pool_swaps(&mut self, cmd: SubscribePoolSwaps) -> Result<(), Error>
fn subscribe_pool_swaps(&mut self, cmd: SubscribePoolSwaps) -> Result<(), Error>
§fn subscribe_pool_liquidity_updates(
&mut self,
cmd: SubscribePoolLiquidityUpdates,
) -> Result<(), Error>
fn subscribe_pool_liquidity_updates( &mut self, cmd: SubscribePoolLiquidityUpdates, ) -> Result<(), Error>
§fn subscribe_pool_fee_collects(
&mut self,
cmd: SubscribePoolFeeCollects,
) -> Result<(), Error>
fn subscribe_pool_fee_collects( &mut self, cmd: SubscribePoolFeeCollects, ) -> Result<(), Error>
§fn subscribe_pool_flash_events(
&mut self,
cmd: SubscribePoolFlashEvents,
) -> Result<(), Error>
fn subscribe_pool_flash_events( &mut self, cmd: SubscribePoolFlashEvents, ) -> Result<(), Error>
§fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> Result<(), Error>
fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> Result<(), Error>
§fn unsubscribe_instruments(
&mut self,
cmd: &UnsubscribeInstruments,
) -> Result<(), Error>
fn unsubscribe_instruments( &mut self, cmd: &UnsubscribeInstruments, ) -> Result<(), Error>
§fn unsubscribe_instrument(
&mut self,
cmd: &UnsubscribeInstrument,
) -> Result<(), Error>
fn unsubscribe_instrument( &mut self, cmd: &UnsubscribeInstrument, ) -> Result<(), Error>
§fn unsubscribe_book_depth(
&mut self,
cmd: &UnsubscribeBookDepth,
) -> Result<(), Error>
fn unsubscribe_book_depth( &mut self, cmd: &UnsubscribeBookDepth, ) -> Result<(), Error>
§fn unsubscribe_mark_prices(
&mut self,
cmd: &UnsubscribeMarkPrices,
) -> Result<(), Error>
fn unsubscribe_mark_prices( &mut self, cmd: &UnsubscribeMarkPrices, ) -> Result<(), Error>
§fn unsubscribe_funding_rates(
&mut self,
cmd: &UnsubscribeFundingRates,
) -> Result<(), Error>
fn unsubscribe_funding_rates( &mut self, cmd: &UnsubscribeFundingRates, ) -> Result<(), Error>
§fn unsubscribe_instrument_status(
&mut self,
cmd: &UnsubscribeInstrumentStatus,
) -> Result<(), Error>
fn unsubscribe_instrument_status( &mut self, cmd: &UnsubscribeInstrumentStatus, ) -> Result<(), Error>
§fn unsubscribe_instrument_close(
&mut self,
cmd: &UnsubscribeInstrumentClose,
) -> Result<(), Error>
fn unsubscribe_instrument_close( &mut self, cmd: &UnsubscribeInstrumentClose, ) -> Result<(), Error>
§fn unsubscribe_blocks(&mut self, cmd: &UnsubscribeBlocks) -> Result<(), Error>
fn unsubscribe_blocks(&mut self, cmd: &UnsubscribeBlocks) -> Result<(), Error>
§fn unsubscribe_pool(&mut self, cmd: &UnsubscribePool) -> Result<(), Error>
fn unsubscribe_pool(&mut self, cmd: &UnsubscribePool) -> Result<(), Error>
§fn unsubscribe_pool_swaps(
&mut self,
cmd: &UnsubscribePoolSwaps,
) -> Result<(), Error>
fn unsubscribe_pool_swaps( &mut self, cmd: &UnsubscribePoolSwaps, ) -> Result<(), Error>
§fn unsubscribe_pool_liquidity_updates(
&mut self,
cmd: &UnsubscribePoolLiquidityUpdates,
) -> Result<(), Error>
fn unsubscribe_pool_liquidity_updates( &mut self, cmd: &UnsubscribePoolLiquidityUpdates, ) -> Result<(), Error>
§fn unsubscribe_pool_fee_collects(
&mut self,
cmd: &UnsubscribePoolFeeCollects,
) -> Result<(), Error>
fn unsubscribe_pool_fee_collects( &mut self, cmd: &UnsubscribePoolFeeCollects, ) -> Result<(), Error>
§fn unsubscribe_pool_flash_events(
&mut self,
cmd: &UnsubscribePoolFlashEvents,
) -> Result<(), Error>
fn unsubscribe_pool_flash_events( &mut self, cmd: &UnsubscribePoolFlashEvents, ) -> Result<(), Error>
§fn request_data(&self, request: RequestCustomData) -> Result<(), Error>
fn request_data(&self, request: RequestCustomData) -> Result<(), Error>
§fn request_book_snapshot(
&self,
request: RequestBookSnapshot,
) -> Result<(), Error>
fn request_book_snapshot( &self, request: RequestBookSnapshot, ) -> Result<(), Error>
§fn request_funding_rates(
&self,
request: RequestFundingRates,
) -> Result<(), Error>
fn request_funding_rates( &self, request: RequestFundingRates, ) -> Result<(), Error>
§fn request_option_chain_reference_price(
&self,
request: RequestOptionChainReferencePrice,
) -> Result<(), Error>
fn request_option_chain_reference_price( &self, request: RequestOptionChainReferencePrice, ) -> Result<(), Error>
§fn request_book_depth(&self, request: RequestBookDepth) -> Result<(), Error>
fn request_book_depth(&self, request: RequestBookDepth) -> Result<(), Error>
Source§impl Debug for InteractiveBrokersDataClient
impl Debug for InteractiveBrokersDataClient
impl DerefToPyAny for InteractiveBrokersDataClient
Source§impl Drop for InteractiveBrokersDataClient
impl Drop for InteractiveBrokersDataClient
impl ExtractPyClassWithClone for InteractiveBrokersDataClient
Source§impl<'py> IntoPyObject<'py> for InteractiveBrokersDataClient
impl<'py> IntoPyObject<'py> for InteractiveBrokersDataClient
Source§type Target = InteractiveBrokersDataClient
type Target = InteractiveBrokersDataClient
Source§type Output = Bound<'py, <InteractiveBrokersDataClient as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <InteractiveBrokersDataClient as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for InteractiveBrokersDataClient
impl PyClass for InteractiveBrokersDataClient
Source§impl PyClassImpl for InteractiveBrokersDataClient
impl PyClassImpl for InteractiveBrokersDataClient
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Interactive Brokers data client.
///
/// This client provides market data functionality using the `rust-ibapi` library.
/// It manages subscriptions, handles historical data requests, and streams
/// market data to NautilusTrader.
const RAW_DOC: &'static CStr = /// Interactive Brokers data client. /// /// This client provides market data functionality using the `rust-ibapi` library. /// It manages subscriptions, handles historical data requests, and streams /// market data to NautilusTrader.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<InteractiveBrokersDataClient as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<InteractiveBrokersDataClient>
type Layout = <<InteractiveBrokersDataClient as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<InteractiveBrokersDataClient>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForInteractiveBrokersDataClient
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyTypeInfo for InteractiveBrokersDataClient
impl PyTypeInfo for InteractiveBrokersDataClient
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.Auto Trait Implementations§
impl !RefUnwindSafe for InteractiveBrokersDataClient
impl !UnwindSafe for InteractiveBrokersDataClient
impl Freeze for InteractiveBrokersDataClient
impl Send for InteractiveBrokersDataClient
impl Sync for InteractiveBrokersDataClient
impl Unpin for InteractiveBrokersDataClient
impl UnsafeUnpin for InteractiveBrokersDataClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>where
Self: IntoPyObject<'py, Error = !>,
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>where
Self: IntoPyObject<'py, Error = !>,
self into a [Py<PyAny>] when the underlying conversion is infallible.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more