Skip to content

stock indicators for .NET

Transform price quotes into trade indicators and market insights.

NuGet Package

NuGet Package

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 →

Get started in minutes ​

Paste this prompt into your coding agent:

prompt
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:

bash
dotnet add package FacioQuo.Stock.Indicators
csharp
// bars: your own historical price data
IReadOnlyList<SmaResult> results = bars.ToSma(20);

Continue with Getting started or Agent setup.

Industry-standard indicators with extensibility ​

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.

Three styles to meet your needs ​

StyleBest for
Batch (Series)Once-and-done bulk calculations on complete datasets
Buffer listsSelf-managed incremental data, sequential processing
Stream hubsLive data feeds with coordinated multi-indicator updates

See the Indicator styles guide for a full feature comparison.

Incrementally add data with buffer lists new in v3 ​

When bars arrive one at a time, buffer lists update without recalculating the entire history.

csharp
// create list
SmaList smaList = new(lookbackPeriods: 20);

// add new bars incrementally
smaList.Add(newBar);

Streaming hubs with observer patterns new in v3 ​

Stream hubs push each new bar through every subscribed indicator, including chained ones, in the correct sequence.

csharp
// 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
}

Powerful chaining for advanced analysis ​

Create indicators of indicators, calculate slope (direction) of any result, or apply moving averages to indicator outputs.

csharp
// 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.

Optimized for modern .NET frameworks ​

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.

Community and support ​

Special thanks to all of our community code contributors!

  • DaveSkender avatar
  • LeeDongGeon1996 avatar
  • tanjera avatar
  • sshquack avatar
  • chetanku avatar
  • Fredrik-C avatar
  • Temppus avatar
  • Balthius avatar
  • mihakralj avatar
  • MithrilMan avatar
  • quoberto avatar
  • RobertWeaver avatar
  • ssathya avatar
  • ooples avatar
  • heavymanto avatar
  • myalgomate avatar
  • nil1st avatar
  • tiger2014 avatar
  • JGronholz avatar