indicator-catalog
Indicator catalog development
File
src/{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
| Style | Pattern | Example |
|---|---|---|
| Series | To{Name} |
ToEma |
| Stream | To{Name}Hub |
ToEmaHub |
| Buffer | To{Name}List |
ToEmaList |
.WithMethodName() must be in style-specific listings, NOT in CommonListing.
Parameter patterns
AddParameter<T>()— int, double, boolAddEnumParameter<T>()— enum typesAddDateParameter()— DateTimeAddSeriesParameter()—IReadOnlyList<T> where T : IReusableminimumandmaximumrequired for all numeric parameters
Result patterns
dataNamemust match property name in Models file exactlyisReusable: trueonly for the property mapping toIReusable.ValueISeriesmodels: all results must haveisReusable: false- Exactly one
isReusable: trueperIReusableindicator
Categories
| Category | Examples |
|---|---|
CandlestickPattern |
Doji, Marubozu |
MovingAverage |
EMA, SMA, HMA, TEMA, WMA, DEMA |
Oscillator |
RSI, Stochastic, MACD, CCI, BOP, CMO, Chop, DPO |
PriceChannel |
Bollinger Bands, Keltner, Donchian, VWAP |
PriceCharacteristic |
ATR, Beta, Standard Deviation, True Range |
PricePattern |
Fractal, Pivot Points |
PriceTransform |
Quote Part, ZigZag |
PriceTrend |
ADX, Aroon, Alligator, AtrStop, SuperTrend, Vortex |
StopAndReverse |
Chandelier, Parabolic SAR, Volatility Stop |
VolumeBased |
OBV, Chaikin Money Flow, Chaikin Oscillator |
Registration
src/_common/Catalog/Catalog.Listings.cs, PopulateCatalog() — alphabetical order:
_catalog.Add(Ema.SeriesListing);
_catalog.Add(Ema.StreamListing);
_catalog.Add(Ema.BufferListing);
Prohibited
.WithMethodName()inCommonListing- Wrong indicator method name
isReusable: trueforISeriesmodels- Multiple
isReusable: trueresults per indicator
Testing
tests/indicators/{folder}/{Indicator}/{Indicator}.Catalog.Tests.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");
}
}
More from daveskender/stock.indicators
indicator-buffer
Implement BufferList incremental indicators with efficient state management. Use for IIncrementFromChain or IIncrementFromQuote implementations. Covers interface selection, constructor patterns, and BufferListTestBase testing requirements.
17testing-standards
Testing conventions for Stock Indicators. Use for test naming (MethodName_StateUnderTest_ExpectedBehavior), FluentAssertions patterns, precision requirements, and test base class selection.
16performance-testing
Benchmark indicator performance with BenchmarkDotNet. Use for Series/Buffer/Stream benchmarks, regression detection, and optimization patterns. Target 1.5x Series for StreamHub, 1.2x for BufferList.
15code-completion
Quality gates checklist for completing code work before finishing implementation cycles
14indicator-series
Implement Series-style batch indicators with mathematical precision. Use for new StaticSeries implementations or optimization. Series results are the canonical reference—all other styles must match exactly. Focus on cross-cutting requirements and performance optimization decisions.
13indicator-stream
Implement StreamHub real-time indicators with O(1) performance. Use for ChainHub or QuoteProvider implementations. Covers provider selection, RollbackState patterns, performance anti-patterns, and comprehensive testing with StreamHubTestBase.
13