indicator-buffer

BufferList indicator development

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "indicator-buffer" with this command: npx skills add daveskender/stock.indicators/daveskender-stock-indicators-indicator-buffer

BufferList indicator development

Interface selection

Interface Additional Inputs Use Case

IIncrementFromChain

IReusable , (DateTime, double)

Chainable single-value indicators

IIncrementFromQuote

(none — only IQuote from base) Requires OHLCV properties

See references/interface-selection.md for decision tree.

Constructor pattern

The chaining constructor parameter type depends on the interface implemented:

// IIncrementFromChain — chaining ctor takes IReadOnlyList<IReusable> public class EmaList : BufferList<EmaResult>, IIncrementFromChain, IEma { public EmaList(int lookbackPeriods) { Ema.Validate(lookbackPeriods); LookbackPeriods = lookbackPeriods; _buffer = new Queue<double>(lookbackPeriods); }

public EmaList(int lookbackPeriods, IReadOnlyList&#x3C;IReusable> values)
    : this(lookbackPeriods) => Add(values);

}

// IIncrementFromQuote — chaining ctor takes IReadOnlyList<IQuote> public class AdxList : BufferList<AdxResult>, IIncrementFromQuote, IAdx { public AdxList(int lookbackPeriods) { Adx.Validate(lookbackPeriods); LookbackPeriods = lookbackPeriods; }

public AdxList(int lookbackPeriods, IReadOnlyList&#x3C;IQuote> quotes)
    : this(lookbackPeriods) => Add(quotes);

}

Buffer management

  • _buffer.Update(capacity, value) — standard rolling buffer

  • _buffer.UpdateWithDequeue(capacity, value) — returns dequeued value for sum adjustment

State management

Use Clear() to reset all internal state:

public override void Clear() { base.Clear(); _buffer.Clear(); _bufferSum = 0; }

Testing constraints

  • Inherit BufferListTestBase

  • IIncrementFromChain → implement ITestChainBufferList

  • IIncrementFromQuote → implement ITestQuoteBufferList

  • Series parity: bufferResults.IsExactly(seriesResults)

Required implementation

  • Source code: src/**/{IndicatorName}.BufferList.cs file exists

  • Inherits BufferList<TResult> and implements correct increment interface

  • Two constructors: primary + chaining via : this(...) => Add(...);

  • Uses BufferListUtilities.Update() or UpdateWithDequeue()

  • Clear() resets results and all internal buffers

  • Unit testing: tests/indicators/**/{IndicatorName}.BufferList.Tests.cs exists

  • Inherits BufferListTestBase and implements correct test interface

  • All required abstract + interface methods implemented

  • Verifies equivalence with Series results

  • Catalog registration: Registered in Catalog.Listings.cs

  • Performance benchmark: Add to tools/performance/Perf.Buffer.cs

  • Public documentation: Update docs/indicators/{IndicatorName}.md

  • Regression tests: Add to tests/indicators/**/{IndicatorName}.Regression.Tests.cs

  • Migration guide: Update docs/migration.md for notable and breaking changes from v2

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

code-completion

No summary provided by upstream source.

Repository SourceNeeds Review
General

indicator-catalog

No summary provided by upstream source.

Repository SourceNeeds Review
General

testing-standards

No summary provided by upstream source.

Repository SourceNeeds Review