Skip to content

A multi-targeting .NET framework NuGet library that produces stock indicators. Send in stock quote history and get back the desired indicators. Nothing more. Current indicators include: Accumulation Distribution Line (ADL), Aroon, Average Directional Index (ADX), Average True Range (ATR), Beta Coefficient, Bollinger Bands, Chaikin Money Flow (CM…

License

Notifications You must be signed in to change notification settings

QuocTan/Stock.Indicators

 
 

Repository files navigation

Stock Indicators

NuGet package build status code coverage board status

Skender.Stock.Indicators is a multi-targeting .NET framework library that produces stock indicators. Send in historical stock price quotes and get back desired technical indicators (such as moving average, relative strength, parabolic SAR, etc). Nothing more.

It can be used in any kind of stock analysis software. We had private trading algorithms and charts in mind when originally creating this open library.

Installation and setup

Find and install the Skender.Stock.Indicators NuGet package into your Project. See more help for installing packages.

# dotnet CLI example
dotnet add package Skender.Stock.Indicators

# PowerShell example
Install-Package Skender.Stock.Indicators

Example usage

using Skender.Stock.Indicators;

[..]

// example: get 20-period simple moving average
IEnumerable<SmaResult> results = Indicator.GetSma(history,20);

Indicators and overlays

Helpful references

Prerequisite data

Most indicators require that you provide historical quote data and additional configuration parameters.

You can get historical quotes from your favorite stock data provider. Historical data is an IEnumerable of the Quote class. More info...

For additional configuration parameters, default values are provided when there is an industry standard. You can, of course, override these and provide your own values.

Frameworks targeted

  • .NET Core 3.1
  • .NET Standard 2.0, 2.1
  • .NET Framework 4.6.1

FAQ

Where can I get historical data?

There are many places to get stock market data. Check with your brokerage or other commercial sites. If you're looking for a free developer API, try Alpha Vantage.

How much historical data do I need?

Each indicator will need different amounts to calculate. You can find guidance on the individual indicator documentation pages. As a general rule of thumb, you will be safe if you provide 750 points of historical quote data (e.g. 3 years of daily data). A BadHistoryException will be thrown if you do not provide enough history.

Note that some indicators, especially those that are derived from Exponential Moving Average, use a smoothing technique where there is convergence over time. While you can calculate these with the minimum amount of data, the precision to two decimal points often requires 250 or more preceding historical records. For example, if you are using daily data and want one year of precise EMA(250) data, you need to provide 3 years of total historical quotes (1 extra year for the lookback period and 1 extra year for convergence); thereafter, you would discard or not use the first two years of results.

Do you have any documentation?

Yes. The documentation site is a GitHub Pages site here: https://daveskender.github.io/Stock.Indicators. It is automatically generated from the README.md files in this repository, so you can navigate from the above Indicators links too.

More questions? Contact us through the NuGet Contact Owners method or submit an Issue with your question if it is publicly relevant.

Contributing

This NuGet package is an open-source project. If you want to report or contribute bug fixes, new indicators, or feature requests, please review our contributing guidelines.

About

A multi-targeting .NET framework NuGet library that produces stock indicators. Send in stock quote history and get back the desired indicators. Nothing more. Current indicators include: Accumulation Distribution Line (ADL), Aroon, Average Directional Index (ADX), Average True Range (ATR), Beta Coefficient, Bollinger Bands, Chaikin Money Flow (CM…

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%