DaveSkender / Stock.Indicators

Stock Indicators for .NET is a C# NuGet package that transforms raw equity, commodity, forex, or cryptocurrency financial market price quotes into technical indicators and trading insights. You'll need this essential data in the investment tools that you're building for algorithmic trading, technical analysis, machine learning, or visual charting.
https://dotnet.StockIndicators.dev
Apache License 2.0
950 stars 236 forks source link

add isolated increment methods #1091

Open DaveSkender opened 10 months ago

DaveSkender commented 10 months ago

Implement incrementing scenarios to calculate the next indicator bar:

Internals

1 uses cached data instead of inputs

Public APIs2

2 repoints internal cache, then uses internal base increment? this wouldn't perform well if provided data is re-written to memory, but am not sure how to handle CLR compliance otherwise with by reference.

Other considerations

DaveSkender commented 1 month ago

For the static non-observable time-series implementation, an approach to explore might be in the following form; though, it may need be IReadOnlyList or IEnumerable base.

public static class Ema : List<EmaResult>
{
    /* saved properties + minimal quote cache */

    /* new quotes */
    void Add(TQuote quote) { ... }

    /* throw simple exception when quotes arrive out of order */
}