Files
QuanTAlib/README.md
T
Miha Kralj b3a64f18fa Implement ZTEST: One-Sample t-Test Statistic with validation tests
- Added Ztest class to compute the one-sample t-statistic using sample standard deviation with Bessel correction.
- Implemented validation tests for Ztest to ensure accuracy against manual calculations and PineScript.
- Updated documentation for Ztest, detailing its mathematical foundation, performance profile, and common pitfalls.
- Adjusted NDepend badges to reflect changes in code metrics after implementation.
- Updated missing indicators report to reflect the completion of statistical indicators, including ZTEST.
2026-02-16 16:54:36 -08:00

7.2 KiB

Codacy grade codecov Security Rating CodeFactor
Nuget GitHub last commit Nuget .NET

Indicators Classes Files Methods Lines of Code
Public APIs Comments

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 18 Signal processing and noise reduction filters Bessel, Butterworth, Gaussian, Savitzky-Golay, Ehlers Super Smoother
Oscillators 19 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

Browse all 284 indicators →

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.