indicator-buffer
Assists in implementing BufferList incremental indicators for chain or quote processing.
Install
mkdir -p .claude/skills/indicator-buffer && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4121" && unzip -o skill.zip -d .claude/skills/indicator-buffer && rm skill.zipInstalls to .claude/skills/indicator-buffer
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Implement BufferList incremental indicators with efficient state management. Use for IIncrementFromChain or IIncrementFromBar implementations. Covers interface selection, constructor patterns, and BufferListTestBase testing requirements.Key capabilities
- →Implement incremental indicators
- →Manage state for IIncrementFromChain or IIncrementFromBar
- →Verify series parity in tests
- →Register indicators in the catalog
How it works
The skill provides a framework for developing incremental indicators by inheriting from BufferList, implementing specific interfaces, and using rolling buffers for efficient state management.
Inputs & outputs
When to use indicator-buffer
- →Implement financial indicators
- →Use BufferList for state management
- →Write tests for indicator implementations
About this skill
BufferList indicator development
A BufferList must produce results identical to the Series output for the same input. The indicator-series skill owns the full per-indicator file set and completion checklist; this skill covers only the {Name}List.cs file and its tests.
Increment interface
Pick the interface from the Series input type. Both are internal and live in src/Common/BufferLists/.
| Series input | Interface | Add overloads to implement |
|---|---|---|
IReadOnlyList<IReusable> | IIncrementFromChain | Add(DateTime timestamp, double value), Add(IReusable value), Add(IReadOnlyList<IReusable> values) |
IReadOnlyList<IBar> | IIncrementFromBar | Add(IBar bar), Add(IReadOnlyList<IBar> bars) |
- Route every chain overload through
Add(DateTime, double)so the calculation exists once. - Pass
value.Valuefrom theIReusableoverloads, orvalue.Hl2OrValue()where the Series defaults bars to HL2 (Alligator and Awesome, for example). - An
IIncrementFromBarlist has noIReusableoverloads. It accepts bars and any result that is anIBar(such asHeikinAshiResult, aBarrecord), but never an arbitraryIReusableresult.
Class shape
src/Indicators/e-j/Ema/EmaList.cs (chain) and src/Indicators/a-b/Adx/AdxList.cs (bar) are the reference implementations.
public class EmaList : BufferList<EmaResult>, IIncrementFromChain, IEma
{
private readonly Queue<double> _buffer;
public EmaList(int lookbackPeriods)
{
Ema.Validate(lookbackPeriods);
LookbackPeriods = lookbackPeriods;
_buffer = new Queue<double>(lookbackPeriods);
Name = $"EMA({lookbackPeriods})";
}
public EmaList(int lookbackPeriods, IReadOnlyList<IReusable> values)
: this(lookbackPeriods) => Add(values);
}
public static partial class Ema
{
public static EmaList ToEmaList(
this IReadOnlyList<IReusable> source,
int lookbackPeriods)
=> new(lookbackPeriods) { source };
}
- The primary constructor validates with the Series
Validate(...), stores parameters asI{Name}properties, allocates buffers, and setsName. - The chaining constructor takes
IReadOnlyList<IReusable>orIReadOnlyList<IBar>to match the interface and delegates with: this(...) => Add(...). - The
To{Name}List()extension sits in the same file and uses a collection initializer. - Append results with
AddInternal(...), which also enforcesMaxListSize; revise an earlier result withUpdateInternal(index, ...).
Buffers and state
- Roll a fixed window with
_buffer.Update(capacity, value)fromBufferListUtilities. - Use
_buffer.UpdateWithDequeue(capacity, value)to maintain a running sum. For a value-typeTit returnsdefault(T)(0), notnull, when nothing was dequeued, so gate the subtraction on whether the buffer was full before the call. - Override
Clear()to callbase.Clear()and reset every buffer, running sum, and cached prior value. - When the list keeps history outside a capacity-bounded
Queue<T>(aList<T>cache, for example), overridePruneList()so that history shrinks with the list.
Tests
{Name}BufferListTests inherits BufferListTestBase and implements ITestChainBufferList for IIncrementFromChain or ITestBarBufferList for IIncrementFromBar, plus ITestCustomBufferListCache for a custom cache. Every test that produces results asserts IsExactly against the Series output. The testing-standards skill lists the required methods.
Do not do these
- Do not add
Add(IBar)overloads to anIIncrementFromChainlist orAdd(IReusable)overloads to anIIncrementFromBarlist. - Do not reimplement the Series formula differently; reuse its
Increment(...)kernel where one exists. - Do not grow an internal collection without bound; every buffer is capacity-limited or pruned with the list.
When not to use it
- →When implementing non-incremental indicators
- →When the indicator does not require state management
Prerequisites
Limitations
- →Requires adherence to specific constructor patterns
- →Testing requires implementation of specific test interfaces
How it compares
It enforces a standardized development and testing pattern for incremental indicators, ensuring consistency and performance compared to ad-hoc implementations.
Compared to similar skills
indicator-buffer side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| indicator-buffer (this skill) | 1 | 4mo | No flags | Advanced |
| zod-4 | 12 | 10mo | No flags | Intermediate |
| develop-ai-functions-example | 5 | 9mo | Review | Intermediate |
| agent-implementer-sparc-coder | 1 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by DaveSkender
View all by DaveSkender →You might also like
zod-4
prowler-cloud
Zod 4 schema validation patterns. Trigger: When creating or updating Zod v4 schemas for validation/parsing (forms, request payloads, adapters), including v3 -> v4 migration patterns.
develop-ai-functions-example
vercel
Develop examples for AI SDK functions. Use when creating, running, or modifying examples under examples/ai-functions/src to validate provider support, demonstrate features, or create test fixtures.
agent-implementer-sparc-coder
ruvnet
Agent skill for implementer-sparc-coder - invoke with $agent-implementer-sparc-coder
perplexity-local-dev-loop
jeremylongshore
Configure Perplexity local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Perplexity. Trigger with phrases like "perplexity dev setup", "perplexity local development", "perplexity dev environment", "develop with perplexity".
add-policy
microsoft
Use when adding, modifying, or reviewing VS Code configuration policies. Covers the full policy lifecycle from registration to export to platform-specific artifacts. Run on ANY change that adds a `policy:` field to a configuration property.
node
dannybrown37
Invoke when the user is writing or debugging TypeScript or JavaScript code, working with Node.js tooling, or asking about ESLint/Prettier configuration.