nautilus_indicators/lib.rs
1// -------------------------------------------------------------------------------------------------
2// Copyright (C) 2015-2025 Posei Systems Pty Ltd. All rights reserved.
3// https://poseitrader.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 [PoseiTrader](http://poseitrader.io).
17//!
18//! The *indicators* crate provides a comprehensive 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//! # Platform
34//!
35//! [PoseiTrader](http://poseitrader.io) is an open-source, high-performance, production-grade
36//! algorithmic trading platform, providing quantitative traders with the ability to backtest
37//! portfolios of automated trading strategies on historical data with an event-driven engine,
38//! and also deploy those same strategies live, with no code changes.
39//!
40//! PoseiTrader's design, architecture, and implementation philosophy prioritizes software correctness and safety at the
41//! highest level, with the aim of supporting mission-critical, trading system backtesting and live deployment workloads.
42//!
43//! # Feature flags
44//!
45//! This crate provides feature flags to control source code inclusion during compilation,
46//! depending on the intended use case, i.e. whether to provide Python bindings
47//! for the [posei_trader](https://pypi.org/project/posei_trader) Python package,
48//! or as part of a Rust only build.
49//!
50//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
51
52#![warn(rustc::all)]
53#![deny(unsafe_code)]
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;