Add indicator

From cinar/indicator · View interactive version

Add indicator is an AI agent skill from the GitHub repository cinar/indicator. Add a new technical analysis indicator to the project. Use when you need to implement a new indicator (e.g., SMA, EMA, RSI) following the project's streaming data patterns, Go generics, and channel-based API.

How to use this skill

Skill file

Add Indicator

This skill provides the workflow and standards for adding new technical analysis indicators to the indicator project.

Workflow

1. Identify Category and Location

Indicators are organized by their technical analysis category. Determine where the new indicator belongs:

2. Implementation Standards

Streaming Data Patterns
Generics and Types
Example Implementation (inspired by `trend/macd.go`)
type MyIndicator[T helper.Number] struct {
    Period int
}

func NewMyIndicator[T helper.Number](period int) *MyIndicator[T] {
    return &MyIndicator[T]{Period: period}
}

func (m *MyIndicator[T]) Compute(c <-chan T) <-chan T {
    // Implementation using helper functions and Go routines
}

func (m *MyIndicator[T]) IdlePeriod() int {
    return m.Period - 1
}

3. Preventing Deadlocks

4. Testing Requirements

```bash

go test -v ./trend -run TestMyIndicator -timeout 30s

```

5. Documentation and Integration

Reference Examples

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.