Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ooples authored Jul 1, 2022
1 parent 8e39baf commit 93ec921
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This is a stock indicator library that is completely open source and very easy to use. Current version contains [762 stock indicators](https://ooples.github.io/OoplesFinance.StockIndicators/indicators) and I will add more as I get requests for them!


### How to use this library

Here is an example to show how easy it is to create indicators using other indicators
Expand Down Expand Up @@ -45,8 +46,23 @@ var middleBandList = results.OutputValues["MiddleBand"];
var lowerBandList = results.OutputValues["LowerBand"];
```

It is extremely important to remember that if you use the same data source to calculate different indicators without using the chaining method then you need to clear the data in between each call. We have a great example for this below:
```cs
var stockData = new StockData(bars.Select(x => x.Open), bars.Select(x => x.High), bars.Select(x => x.Low),
bars.Select(x => x.Close), bars.Select(x => x.Volume), bars.Select(x => x.TimeUtc), InputName.High);

var sma = stockData.CalculateSimpleMovingAverage(14);

// if you don't perform these clear methods in between then your ema result will be calculated using the sma results
stockData.SignalsList.Clear();
stockData.CustomValuesList.Clear();

var ema = stockData.CalculateExponentialMovingAverage(14);
```

For more detailed Alpaca examples then check out my more advanced [Alpaca example code](https://github.com/alpacahq/alpaca-trade-api-csharp/blob/develop/UsageExamples/IndicatorLibraryExample.cs)


### Support This Project

BTC: 36DRmZefJNW82q9pHY1kWYSZhLUWQkpgGq
Expand Down

0 comments on commit 93ec921

Please sign in to comment.