add-indicator

Featured

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.

Data & Documents 1,103 stars 182 forks Updated today AGPL-3.0

Install

View on GitHub

Quality Score: 90/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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: - `trend/`: Trend-following indicators (SMA, EMA, MACD, etc.) - `momentum/`: Momentum indicators (RSI, Stochastic, etc.) - `volatility/`: Volatility indicators (Bollinger Bands, ATR, etc.) - `volume/`: Volume-based indicators (OBV, Chaikin Money Flow, etc.) - `valuation/`: Asset valuation (FV, NPV, etc.) ### 2. Implementation Standards #### Streaming Data Patterns - Indicators MUST operate on unlimited data streams using Go routines and channels. - Use `<-chan T` for inputs and `<-chan T` (or multiple channels) for outputs. - Indicators may have an "idle" or "warm-up" period where they don't produce output until their internal window is filled. #### Generics and Types - All indicators must use Go generics with the `helper.Number` constraint. - Define a struct for the indicator and a `New<Indicator>` factory function. - Implement a `Compute` method: `func (i *Indicator[T]) Compute(c <-chan T) <-chan T`. - Implement an `IdlePeriod` method: `func (i *Indicator[T]) IdlePeriod() int` to return the number of elements it skips. #### Example Implementation (inspired by `trend/macd.go`) ```go type MyIndicator[T helper.Number] struct { Period int } func NewMyIndicator[T helper.Number](pe...

Details

Author
cinar
Repository
cinar/indicator
Created
4 years ago
Last Updated
today
Language
Go
License
AGPL-3.0

Similar Skills

Semantically similar based on skill content — not just same category