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

feat: Buffer-style ADX incremental #1271

Merged
merged 7 commits into from
Nov 11, 2024

Conversation

DaveSkender
Copy link
Owner

@DaveSkender DaveSkender commented Nov 11, 2024

Implements #1062. This behaves just like a normal List(), except you'll add quotes incrementally that will auto-convert into an incremental AdxResult and add it to the end of the list. AdxList is equivalent to List<AdxResult>.

AdxList adxList = new(lookbackPeriods: 14);

foreach (IQuote quote in quotes)
{
    adxList.Add(quote);
}

This buffer-style list is a lightweight, simple way to implement incremental indicators. It's a middle alternative between the performance of time-series batches (existing v2 library) and the more advanced streaming hub ecosystem.

Done when

  • refactor to abstract BufferList():List
  • shorten path from IEnumerable to date/value Add()
  • add ADX buffer-style list

Related to:

@DaveSkender DaveSkender added this to the v3 milestone Nov 11, 2024
@DaveSkender DaveSkender self-assigned this Nov 11, 2024
@DaveSkender DaveSkender linked an issue Nov 11, 2024 that may be closed by this pull request
@DaveSkender DaveSkender added the experiment Pseudo-fork for experimental (do not merge) label Nov 11, 2024
@DaveSkender
Copy link
Owner Author

There's some refactoring still do do here, which I plan to do when implementing the hub.

Here's some relative performance between this buffer list and the straight time series. For comparison, I've included the notably simpler calculating EMA for comparison to the streaming approach. Generally, the incrementing buffer approach has more overhead and is 2-3× less performant than the full original static time series. The streaming hub is slower than both, but is more robust with larger datasets.

Method Mean Error StdDev
AdxBuffer 51.621 us 11.4208 us 0.6260 us
AdxSeries 14.169 us 2.7392 us 0.1501 us
EmaBuffer 4.019 us 0.7001 us 0.0384 us
EmaSeries 2.621 us 0.6898 us 0.0378 us
EmaStream 27.899 us 16.6569 us 0.9130 us

@DaveSkender DaveSkender marked this pull request as ready for review November 11, 2024 23:07
@DaveSkender DaveSkender merged commit 3d7bbf6 into v3 Nov 11, 2024
17 checks passed
@DaveSkender DaveSkender deleted the 1062-idea-increment-approach-for-adx branch November 11, 2024 23:08
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
experiment Pseudo-fork for experimental (do not merge)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Idea: Increment approach for ADX
1 participant