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.

Home Page:https://dotnet.StockIndicators.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add isolated increment methods

DaveSkender opened this issue · comments

Implement incrementing scenarios to calculate the next indicator bar:

Internals

  • base increment1
  • observer OnNext() handler

1 uses cached data instead of inputs

Public APIs2

  • base increment (system agnostic I/O), all needed inputs, appropriate TResult out
  • external cached (like observer handler, but using external data storage interface), consider cache-aside design pattern.

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

  • static time-series implementation (see below)

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