nt-features
Technical indicators and feature engineering for quantitative trading strategies.
The nt-features crate provides a comprehensive library of technical indicators, statistical features, and feature engineering tools optimized for algorithmic trading.
Features
- 100+ Technical Indicators - Moving averages, oscillators, volatility, volume
- Statistical Features - Rolling statistics, correlations, distributions
- Feature Engineering - Automated feature generation and selection
- Polars Integration - High-performance DataFrame operations
- Lazy Evaluation - Efficient computation with Polars lazy API
- Custom Indicators - Extensible framework for custom indicators
- Real-Time Processing - Stream-friendly incremental calculations
- GPU Acceleration - Optional CUDA support for large datasets
Technical Indicators
Trend Indicators
- Simple Moving Average (SMA)
- Exponential Moving Average (EMA)
- Weighted Moving Average (WMA)
- MACD (Moving Average Convergence Divergence)
- ADX (Average Directional Index)
- Parabolic SAR
Momentum Indicators
- RSI (Relative Strength Index)
- Stochastic Oscillator
- Williams %R
- Rate of Change (ROC)
- Momentum
- CCI (Commodity Channel Index)
Volatility Indicators
- Bollinger Bands
- ATR (Average True Range)
- Keltner Channels
- Standard Deviation
- Historical Volatility
Volume Indicators
- On-Balance Volume (OBV)
- Volume-Weighted Average Price (VWAP)
- Accumulation/Distribution
- Chaikin Money Flow
- Volume Oscillator
Quick Start
[]
= "0.1"
Basic Usage
use ;
use *;
async
Feature Engineering
use ;
use *;
async
Real-Time Indicators
use ;
async
Architecture
nt-features/
├── indicators/
│ ├── trend.rs # Trend indicators (SMA, EMA, MACD)
│ ├── momentum.rs # Momentum indicators (RSI, Stochastic)
│ ├── volatility.rs # Volatility indicators (Bollinger, ATR)
│ ├── volume.rs # Volume indicators (OBV, VWAP)
│ └── streaming.rs # Real-time streaming indicators
├── statistics/
│ ├── rolling.rs # Rolling statistics
│ ├── correlation.rs # Correlation analysis
│ └── distributions.rs # Distribution metrics
├── feature_engine.rs # Automated feature generation
├── selection.rs # Feature selection algorithms
└── lib.rs
Performance
| Operation | Throughput | Latency |
|---|---|---|
| SMA calculation | 10M+ samples/sec | <1μs |
| RSI calculation | 5M+ samples/sec | <2μs |
| Feature generation | 100K+ rows/sec | <10ms |
| Streaming update | <100ns | Real-time |
Benchmarks run on: AMD EPYC 7763 (single core)
Dependencies
| Crate | Purpose |
|---|---|
nt-core |
Core types |
polars |
DataFrame operations |
statrs |
Statistical functions |
ndarray |
Numerical arrays |
rayon |
Parallel processing |
Testing
# Unit tests
# Benchmarks
# Property-based tests
Contributing
Contributions welcome! Areas for improvement:
- Additional technical indicators
- GPU acceleration for more indicators
- Feature selection algorithms
- Documentation and examples
License
Licensed under MIT OR Apache-2.0.