OpenParable
Skip to content
← Back to skills

Indicator Catalog

Development
indicator-catalog

Indicator Catalog is an Agent Skill for development published in the facioquo/stock-indicators-dotnet repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Create and register indicator catalog entries for automation. Use for Catalog.cs files, CatalogListingBuilder patterns, parameter/result definitions, and PopulateCatalog registration.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/facioquo/stock-indicators-dotnet/blob/HEAD/.agents/skills/indicator-catalog/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/indicator-catalog, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Indicator catalog development

File

src/Indicators/{category}/{Indicator}/{Indicator}.Catalog.cs

Builder pattern

public static partial class Ema
{
    /// <summary>
    /// EMA Common Base Listing
    /// </summary>
    internal static readonly IndicatorListing CommonListing =
        new CatalogListingBuilder()
            .WithName("Exponential Moving Average")
            .WithId("EMA")
            .WithCategory(Category.MovingAverage)
            .AddParameter<int>("lookbackPeriods", "Lookback Period",
                description: "Number of periods for the EMA calculation",
                isRequired: true, defaultValue: 20, minimum: 2, maximum: 250)
            .AddResult("Ema", "EMA", ResultType.Default, isReusable: true)
            .Build();

    /// <summary>
    /// EMA Series Listing
    /// </summary>
    internal static readonly IndicatorListing SeriesListing =
        new CatalogListingBuilder(CommonListing)
            .WithStyle(Style.Series)
            .WithMethodName("ToEma")
            .Build();

    /// <summary>
    /// EMA Stream Listing
    /// </summary>
    internal static readonly IndicatorListing StreamListing =
        new CatalogListingBuilder(CommonListing)
            .WithStyle(Style.Stream)
            .WithMethodName("ToEmaHub")
            .Build();

    /// <summary>
    /// EMA Buffer Listing
    /// </summary>
    internal static readonly IndicatorListing BufferListing =
        new CatalogListingBuilder(CommonListing)
            .WithStyle(Style.Buffer)
            .WithMethodName("ToEmaList")
            .Build();
}

Method naming

StylePatternExample
SeriesTo{Name}ToEma
StreamTo{Name}HubToEmaHub
BufferTo{Name}ListToEmaList

.WithMethodName() must be in style-specific listings, NOT in CommonListing.

Parameter patterns

  • AddParameter<T>() — primitive value types (typically int or double)
  • AddEnumParameter<T>() — enum types
  • AddDateParameter() — DateTime
  • AddSeriesParameter() — IReadOnlyList<T> where T : IReusable
  • minimum and maximum required for all numeric parameters

Result patterns

  • dataName must match property name in Models file exactly
  • isReusable: true only for the property mapping to IReusable.Value
  • ISeries models: all results must have isReusable: false
  • Exactly one isReusable: true per IReusable indicator

Categories

CategoryExamples
CandlestickPatternDoji, Marubozu
MovingAverageEMA, SMA, HMA, TEMA, WMA, DEMA
OscillatorRSI, Stochastic, MACD, CCI, BOP, CMO, Chop, DPO
PriceChannelBollinger Bands, Keltner, Donchian, VWAP
PriceCharacteristicATR, Beta, Standard deviation, True Range
PricePatternFractal, Pivot Points
PriceTransformBar Part, ZigZag
PriceTrendADX, Aroon, Alligator, AtrStop, SuperTrend, Vortex
StopAndReverseChandelier, Parabolic SAR, Volatility Stop
VolumeBasedOBV, Chaikin Money Flow, Chaikin Oscillator

Registration

Add entries inside the host repository's catalog populator method. The backing collection is a private static readonly List<IndicatorListing> declared at the top of the catalog file; the host repository determines its field name (shown below as listings).

Indicators are grouped alphabetically by indicator ID (abbreviation) and separated by a blank line. Each block is preceded by a short comment header — // {Abbreviation} ({Full Name}) when an abbreviation is conventional, otherwise just // {Full Name}. Within a block, the preferred order for the style listings is Buffer → Series → Stream:

// EMA (Exponential Moving Average)
listings.Add(Ema.BufferListing);
listings.Add(Ema.SeriesListing);
listings.Add(Ema.StreamListing);

// HMA (Hull Moving Average)
listings.Add(Hma.BufferListing);
listings.Add(Hma.SeriesListing);
listings.Add(Hma.StreamListing);

Series-only indicators (no streamable variant) register a single SeriesListing line in the same alphabetical position; e.g.:

// Beta
listings.Add(Beta.SeriesListing);

Prohibited

  • .WithMethodName() in CommonListing
  • Wrong indicator method name
  • isReusable: true for ISeries models
  • Multiple isReusable: true results per indicator

Testing

tests/Library/Indicators/{folder}/{Indicator}/{Indicator}CatalogTests.cs:

[TestClass]
public class EmaCatalogTests : TestBase
{
    [TestMethod]
    public void EmaSeriesListing()
    {
        var listing = Ema.SeriesListing;
        listing.Name.Should().Be("Exponential Moving Average");
        listing.Style.Should().Be(Style.Series);
        listing.MethodName.Should().Be("ToEma");
    }
}