Skip to content

stock indicators for .NET

Transform price quotes into trade indicators and market insights.

NuGet Package

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 →

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.

Simple, intuitive API

csharp
// example: calculate 20-period simple moving average
IReadOnlyList<SmaResult> results = bars.ToSma(20);

See more usage examples.

Three styles to meet your needs

The library provides three indicator styles for different use cases.

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 preview

For scenarios where bars arrive one at a time, buffer lists provide efficient incremental processing without recalculating the entire history.

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

Streaming hubs with observer patterns preview

Hubs provides a reactive, subscription-based pattern for streaming market data with automatic cascading calculations for advances scenarios.

Example 1: Chained hubs

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

Example 2: signal-based strategy

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

Powerful chaining for advanced analysis

Chain indicators together for sophisticated technical 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

Our NuGet library directly targets all actively supported Microsoft .NET platforms for peak performance.

  • .NET 10.0, 9.0, 8.0

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.

Licensed for everyone

Apache 2.0 license badge

This repository uses the standard Apache 2.0 open-source license. Please review the license before using or contributing to the software.

Share your ideas with the community

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.

Give back with patronage

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.

Contribute to help others

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!

  • 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

Visit our GitHub repository to begin contributing, or browse the full list of indicators and overlays.