- Updated the name and description of the Hilbert Trendline (HTIT) to "Ehlers Hilbert Transform Instantaneous Trend (HTIT)". - Changed the name and description of the MESA Adaptive Moving Average (MAMA) to "Ehlers MESA Adaptive Moving Average". - Modified the Center of Gravity (CG) indicator to "Ehlers Center of Gravity (CG)". - Renamed the Detrended Synthetic Price (DSP) to "Ehlers Detrended Synthetic Price (DSP)". - Updated the Autocorrelation Periodogram (EACP) to "Ehlers Autocorrelation Periodogram (EACP)". - Changed the Homodyne Discriminator (HOMOD) to "Ehlers Homodyne Discriminator (HOMOD)". - Updated the Hilbert Transform Dominant Cycle Period and Phase indicators to include "Ehlers" in their names. - Renamed the Hilbert Transform Phasor Components to "Ehlers Hilbert Transform Phasor Components (HT_PHASOR)". - Updated the SineWave indicator to "Ehlers Hilbert Transform SineWave (HT_SINE)". - Changed the Phasor Analysis indicator to "Ehlers Hilbert Transform Phasor Components (HT_PHASOR)". - Updated the SSF-Based Detrended Synthetic Price to "Ehlers SSF Detrended Synthetic Price (SSFDSP)". - Renamed the Ultimate Channel to "Ehlers Ultimate Channel (UCHANNEL)". - Added new indicators: Moving Average Variable Period (MAVP), Ehlers Predictive Moving Average (PMA), Ehlers Reverse EMA (REVERSEEMA), and Ehlers Trendflex Indicator (TRENDFLEX). - Updated various SVG badges to reflect changes in classes, comments, source files, lines of code, methods, and public types.
Static code analysis provided by ndepend
QuanTAlib - Quantitative Technical Indicators Without Compromises
TA libraries face a fundamental choice: accept approximations for simplicity OR enforce math rigor. QuanTAlib chooses rigor.
Quantitative TA library (QuanTAlib) is a C# library built on the premise that you shouldn't have to choose. Modern CPUs process 4-8 FLOPS per cycle via SIMD. Modern .NET exposes memory layouts making hardware acceleration trivial. QuanTAlib exploits both. Result: mathematically rigorous indicators at speeds making real-time multi-symbol analysis practical on ordinary hardware.
Key Features
- Zero Allocation: Hot paths are allocation-free. No GC pauses during trading.
- SIMD Accelerated: Uses AVX2/AVX-512 for 8x throughput on modern CPUs.
- O(1) Streaming: Constant time updates regardless of lookback period.
- Platform Agnostic: Runs on .NET 8/9/10, compatible with Quantower, NinjaTrader, QuantConnect.
- Mathematically Rigorous: Validated against original research papers and established libraries.
Indicators
| Category | Count | What It Measures | Representative Indicators |
|---|---|---|---|
| Trends (FIR) | 17 | Finite Impulse Response moving averages | SMA, WMA, HMA, ALMA, TRIMA, LSMA, EPMA |
| Trends (IIR) | 23 | Infinite Impulse Response moving averages | EMA, DEMA, TEMA, T3, JMA, KAMA, VIDYA |
| Filters | 31 | Signal processing and noise reduction filters | Bessel, Butterworth, Gaussian, Savitzky-Golay, Ehlers Super Smoother |
| Oscillators | 20 | Indicators that fluctuate around a center line | RSI, MACD, Stochastic, AO, APO, CCI, Ultimate Oscillator |
| Dynamics | 18 | Trend strength and direction indicators | ADX, Aroon, SuperTrend, Vortex, Chop, Ichimoku |
| Momentum | 16 | Speed and magnitude of price changes | Momentum, ROC, Velocity, RSX, Qstick, KDJ |
| Volatility | 26 | Size and variability of price movements | ATR, Bollinger Band Width, Historical Volatility, True Range |
| Volume | 26 | Trading activity and price-volume relationships | OBV, VWAP, MFI, ADL, CMF, TVI, Force Index |
| Statistics | 30 | Statistical measures and tests | Correlation, Variance, StdDev, Skewness, Kurtosis, Z-Score |
| Channels | 23 | Price boundaries and range definitions | Bollinger Bands, Keltner Channels, Donchian Channels |
| Cycles | 14 | Cycle analysis and signal processing | Hilbert Transform, Homodyne, Phasor, Ehlers Sine Wave |
| Reversals | 12 | Pattern recognition and reversal detection | Pivot Points, Fractals, Swings, Pivot Components |
| Forecasts | 1 | Predictive indicators and projections | Time Series Forecast, AFIRMA, Chande Forecast Oscillator |
| Errors | 26 | Error metrics and loss functions | RMSE, MAE, MAPE, SMAPE, MASE, R-Squared |
| Numerics | 15 | Mathematical transformations | Log, Exp, Sqrt, Tanh, ReLU, Sigmoid |
Quick Start
Install from NuGet:
dotnet add package QuanTAlib
Calculate an SMA in real-time:
using QuanTAlib;
var sma = new Sma(period: 14);
double price = 100.0;
// Update with new price
var result = sma.Update(new TValue(DateTime.UtcNow, price));
if (result.IsHot)
{
Console.WriteLine($"SMA: {result.Value}");
}
Performance Snapshot
QuanTAlib is designed for speed. Here is how it compares calculating a 500,000 bar SMA against other libraries:
| Library | Mean Time | Allocations | Relative Speed |
|---|---|---|---|
| QuanTAlib (Span) | 318.3 μs | 0 B | 1.00x (baseline) |
| TA-Lib | 356.4 μs | 34 B | 1.12x slower |
| Tulip Indicators | 359.3 μs | 0 B | 1.13x slower |
| Skender Indicators | 71,277 μs | 50.8 MB | 224x slower |
See Benchmarks for full details and methodology.
Documentation
Core Concepts
- Architecture: Learn about SoA layout, SIMD, and design philosophy.
- API Reference: Deep dive into the Tri-Modal Architecture (Batch, Streaming, Priming).
- Indicators: Full catalog of available indicators and their mathematical families.
- Usage Guides: Detailed patterns for Span, Streaming, Batch, and Eventing modes.
- Integration: Setup guides for Quantower, NinjaTrader, and QuantConnect.
Analysis & Validation
- Benchmarks: Detailed performance evidence and test methodology.
- Error Metrics: Implementation details for 20+ error metrics and loss functions.
- Trend Comparison: Comparative analysis of lag, smoothness, and accuracy.
- MA Qualities: Theoretical framework for evaluating moving averages.
- Validation: Verification matrices against TA-Lib, Skender, and other libraries.
- Glossary: Definitions of core QuanTAlib concepts, types, and terminology.