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 turns your own OHLCV price bars, from any market, into moving averages, Relative Strength Index, Stochastic Oscillator, Parabolic SAR, and many other indicators. Use them in trading algorithms, charting apps, machine learning models, and market analysis tools, in batch or in real time.
✨ v3 adds streaming support
FacioQuo.Stock.Indicators, formerly Skender.Stock.Indicators, adds buffer list and stream hub indicators for incremental and real-time price data. Upgrading from v2? See the migration guide →
Paste this prompt into your coding agent:
Read https://dotnet.stockindicators.dev/llms.txt and its getting started guide,
then help me install the FacioQuo.Stock.Indicators NuGet package
and calculate my first indicator from my own price data.Or install it yourself and calculate your first indicator:
dotnet add package FacioQuo.Stock.Indicators// bars: your own historical price data
IReadOnlyList<SmaResult> results = bars.ToSma(20);Continue with Getting started or Agent setup.
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.
| 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.
When bars arrive one at a time, buffer lists update without recalculating the entire history.
// create list
SmaList smaList = new(lookbackPeriods: 20);
// add new bars incrementally
smaList.Add(newBar);Stream hubs push each new bar through every subscribed indicator, including chained ones, in the correct sequence.
// one provider feeds any number of subscribers
BarHub barHub = new();
EmaHub emaFast = barHub.ToEmaHub(50);
EmaHub emaSlow = barHub.ToEmaHub(200);
RsiHub rsiHub = emaFast.ToRsiHub(14); // hubs chain, too
// add each bar as it arrives; all hubs stay in sync
barHub.Add(newBar);
// example: detect a bullish crossover
if (emaFast.Results[^2].Ema < emaSlow.Results[^2].Ema
&& emaFast.Results[^1].Ema > emaSlow.Results[^1].Ema)
{
// fast EMA crossed above slow EMA
}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.
The library directly targets all actively supported .NET versions (10.0, 9.0, and 8.0) for peak performance. It's CLS compliant, so it works well beyond C#, in other languages and platforms that interoperate with .NET.
Special thanks to all of our community code contributors!