Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add standalone buffer-style increment methods #1091

Open
2 tasks
DaveSkender opened this issue Oct 12, 2023 · 3 comments
Open
2 tasks

add standalone buffer-style increment methods #1091

DaveSkender opened this issue Oct 12, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@DaveSkender
Copy link
Owner

DaveSkender commented Oct 12, 2023

Implement standalone buffering incrementing indicators.

// EXPONENTIAL MOVING AVERAGE (INCREMENTING LIST)
/// <summary>
/// Exponential Moving Average (EMA)
/// from incremental reusable values.
/// </summary>
public class EmaList : List<EmaResult>, IEma, IIncrementQuote, IIncrementReusable
{
private readonly Queue<double> _buffer;

done when

@DaveSkender DaveSkender converted this from a draft issue Oct 12, 2023
@DaveSkender DaveSkender added the enhancement New feature or request label Oct 12, 2023
@DaveSkender DaveSkender added this to the v3 milestone Oct 12, 2023
@DaveSkender DaveSkender linked a pull request Oct 12, 2023 that will close this issue
29 tasks
@DaveSkender DaveSkender removed a link to a pull request Nov 24, 2023
29 tasks
@DaveSkender
Copy link
Owner Author

DaveSkender commented Jul 16, 2024

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

Example

public class EmaList : List<EmaResult>, IEma, IIncrementQuote, IIncrementReusable

@DaveSkender
Copy link
Owner Author

Since static increments are part of implementation streaming hubs, I’m repurposing this item to reflect full implementation of the incremental approach mentioned in the last comment. Here’s the original (obsolete scope) for reference:

Implement incrementing scenarios to calculate the next indicator bar:

Internals

  • base increment1
  • observer OnNext() handler

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.

Footnotes

  1. uses cached data instead of inputs

  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.

@DaveSkender DaveSkender changed the title add isolated increment methods add standalone buffer-style increment methods Oct 10, 2024
@DaveSkender DaveSkender modified the milestones: v3, v3.1 Oct 10, 2024
@codebeaulieu
Copy link

This is awesome, had this ideas in mind a while back and never got around to implementing it. Great work Dave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants