stock indicators for .NET
Transform price quotes into trade indicators and market insights.
Transform price quotes into trade indicators and market insights.
Stock Indicators for .NET is a C# library package that transforms batch and streaming financial market price data into technical indicators. Get moving averages, Relative Strength Index, Stochastic Oscillator, Parabolic SAR, and many other indicators.
Build trading algorithms, charting applications, machine learning models, or market analysis tools with your own OHLCV price bars from any market: equities, commodities, forex, or cryptocurrencies.
✨ v3 adds streaming support
Our new FacioQuo.Stock.Indicators NuGet library, formerly Skender.Stock.Indicators, adds stream hub and buffer list style indicators to enable your incremental and real-time price data scenarios. Still on v2? See our migration guide →
Access a comprehensive library of battle-tested technical indicators used by traders worldwide. Extend functionality by creating your own custom indicators that integrate seamlessly with the library.
// example: calculate 20-period simple moving average
IReadOnlyList<SmaResult> results = bars.ToSma(20);See more usage examples.
The library provides three indicator styles for different use cases.
| Style | Best for |
|---|---|
| Batch (Series) | Once-and-done bulk calculations on complete datasets |
| Buffer lists | Self-managed incremental data, sequential processing |
| Stream hubs | Live data feeds with coordinated multi-indicator updates |
See the Indicator styles guide for a full feature comparison.
For scenarios where bars arrive one at a time, buffer lists provide efficient incremental processing without recalculating the entire history.
// create list
SmaList smaList = new(lookbackPeriods: 20);
// add new bars incrementally
smaList.Add(newBar);Buffer lists maintain internal state and automatically manage the warmup period, making them ideal for basic live data feeds and incremental updates.
Hubs provides a reactive, subscription-based pattern for streaming market data with automatic cascading calculations for advances scenarios.
// create provider and subscribe observers
BarHub barHub = new(); // provider
SmaHub smaHub = barHub.ToSmaHub(20);
RsiHub rsiHub = smaHub.ToRsiHub(14); // RSI of SMA
// publish bars - observers auto-update in cascade
barHub.Add(newBar);
// consume downstream hubs indicators
IReadOnlyList<RsiResult> results = rsiHub.Results;// create provider and subscribe observers
BarHub barHub = new();
EmaHub emaFast = barHub.ToEmaHub(50);
EmaHub emaSlow = barHub.ToEmaHub(200);
// add bars to barHub (from stream)
barHub.Add(newBar);
// and the 2 EmaHubs will be in sync
if(emaFast.Results[^2].Ema < emaSlow.Results[^2].Ema
&& emaFast.Results[^1].Ema > emaSlow.Results[^1].Ema)
{
// cross over occurred
}The observer cascade ensures that when a new bar arrives, all chained indicators update automatically in the correct sequence.
See the guide and the full list of indicators and overlays for more information.
Chain indicators together for sophisticated technical analysis: create indicators of indicators, calculate slope (direction) of any result, or apply moving averages to indicator outputs.
// example: calculate RSI of On-Balance Volume
IReadOnlyList<RsiResult> results
= bars.ToObv()
.ToRsi(14);
// example: use custom candle price variants
IReadOnlyList<EmaResult> results
= bars.Use(CandlePart.HL2)
.ToEma(20);See Chaining indicators for more.
Our NuGet library directly targets all actively supported Microsoft .NET platforms for peak performance.
The compiled library package is Common Language Specification (CLS) compliant and can be used in other programming languages, including Python and everything in the .NET universe.
This repository uses the standard Apache 2.0 open-source license. Please review the license before using or contributing to the software.
Need help? Have ideas? Start a new discussion, ask a question 💬, or submit an issue if it is publicly relevant. You can also direct message @daveskender.
Thank you for your support! This software is crafted with care by unpaid enthusiasts who 💖 all forms of encouragement. If you or your organization use this library or like what we're doing, add a ⭐ on the GitHub Repo as a token of appreciation.
If you want to buy me a beer or are interested in ongoing support as a patron, become a sponsor. Patronage motivates continued maintenance and evolution of open-source projects, and to inspire new ones.
This NuGet package is an open-source project on GitHub. If you want to report bugs or contribute fixes, new indicators, or new features, please review our contributing guidelines and the backlog.
Special thanks to all of our community code contributors!
Visit our GitHub repository to begin contributing, or browse the full list of indicators and overlays.