nautilus_indicators/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//! Technical analysis indicators for [NautilusTrader](https://nautilustrader.io).
17//!
18//! The `nautilus-indicators` crate provides a collection of technical analysis indicators
19//! for quantitative trading and market research. This includes a wide variety of indicators
20//! organized by category, with a unified trait-based architecture for consistent usage:
21//!
22//! - **Moving averages**: SMA, EMA, DEMA, HMA, WMA, VWAP, adaptive averages, and linear regression.
23//! - **Momentum indicators**: RSI, MACD, Aroon, Bollinger Bands, CCI, Stochastics, and rate of change.
24//! - **Volatility indicators**: ATR, Donchian Channels, Keltner Channels, and volatility ratios.
25//! - **Ratio analysis**: Efficiency ratios and spread analysis for relative performance.
26//! - **Order book indicators**: Book imbalance ratio for analyzing market microstructure.
27//! - **Common indicator trait**: Unified interface supporting bars, quotes, trades, and order book data.
28//!
29//! All indicators are designed for high-performance real-time processing with bounded memory
30//! usage and efficient circular buffer implementations. The crate supports both Rust-native
31//! usage and Python integration for strategy development and backtesting.
32//!
33//! # NautilusTrader
34//!
35//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native
36//! engine for multi-asset, multi-venue trading systems.
37//!
38//! The system spans research, deterministic simulation, and live execution within a single
39//! event-driven architecture, providing research-to-live semantic parity.
40//!
41//! # Feature Flags
42//!
43//! This crate provides feature flags to control source code inclusion during compilation,
44//! depending on the intended use case, i.e. whether to provide Python bindings
45//! for the [nautilus_trader](https://pypi.org/project/nautilus_trader) Python package,
46//! or as part of a Rust only build.
47//!
48//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
49//! - `extension-module`: Builds the crate as a Python extension module.
50
51#![warn(rustc::all)]
52#![deny(unsafe_code)]
53#![deny(unsafe_op_in_unsafe_fn)]
54#![deny(nonstandard_style)]
55#![deny(missing_debug_implementations)]
56#![deny(clippy::missing_errors_doc)]
57#![deny(clippy::missing_panics_doc)]
58#![deny(rustdoc::broken_intra_doc_links)]
59
60pub mod average;
61pub mod book;
62pub mod indicator;
63pub mod momentum;
64pub mod ratio;
65pub mod testing;
66pub mod volatility;
67
68#[cfg(test)]
69mod stubs;
70
71#[cfg(feature = "python")]
72pub mod python;