Skip to main content

nautilus_interactive_brokers/
lib.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! [NautilusTrader](http://nautilustrader.io) adapter for [Interactive Brokers](https://www.interactivebrokers.com).
17//!
18//! The `nautilus-interactive-brokers` crate provides client bindings for the Interactive Brokers
19//! TWS API using the `rust-ibapi` library, with full integration into NautilusTrader's data and
20//! execution infrastructure.
21//!
22//! # Platform
23//!
24//! [NautilusTrader](http://nautilustrader.io) is an open-source, high-performance, production-grade
25//! algorithmic trading platform, providing quantitative traders with the ability to backtest
26//! portfolios of automated trading strategies on historical data with an event-driven engine,
27//! and also deploy those same strategies live, with no code changes.
28//!
29//! # Feature flags
30//!
31//! This crate provides feature flags to control source code inclusion during compilation,
32//! depending on the intended use case, i.e. whether to provide Python bindings
33//! for the [nautilus_trader](https://pypi.org/project/nautilus_trader) Python package,
34//! or as part of a Rust only build.
35//!
36//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
37//! - `extension-module`: Builds as a Python extension module (used with `python`).
38
39#![warn(rustc::all)]
40#![deny(unsafe_code)]
41// Clippy: allow style lints that would require large refactors across the adapter
42#![allow(
43    clippy::collapsible_if,
44    clippy::if_not_else,
45    clippy::uninlined_format_args,
46    clippy::map_unwrap_or,
47    clippy::redundant_clone,
48    clippy::ignored_unit_patterns,
49    clippy::items_after_statements,
50    clippy::bool_to_int_with_if,
51    clippy::cloned_instead_of_copied,
52    clippy::option_if_let_else,
53    clippy::type_complexity,
54    clippy::await_holding_lock,
55    clippy::module_inception,
56    clippy::result_large_err,
57    clippy::implicit_clone,
58    clippy::single_char_pattern,
59    clippy::bind_instead_of_map,
60    clippy::explicit_iter_loop,
61    clippy::too_many_arguments,
62    clippy::missing_errors_doc,
63    clippy::doc_overindented_list_items,
64    clippy::needless_borrows_for_generic_args
65)]
66#![deny(nonstandard_style)]
67#![deny(missing_debug_implementations)]
68#![deny(clippy::missing_panics_doc)]
69#![deny(rustdoc::broken_intra_doc_links)]
70
71pub mod common;
72pub mod config;
73pub mod data;
74pub mod error;
75pub mod execution;
76pub mod gateway;
77pub mod historical;
78pub mod providers;
79
80#[cfg(feature = "python")]
81pub mod python;