Commit 9c63fd9
authored
spec: add indicator-sma specification (#3657)
## New Specification: `indicator-sma`
Related to #3651
---
### specification.md
# indicator-sma: Simple Moving Average (SMA) Indicator Chart
## Description
A Simple Moving Average (SMA) chart displays price or value data with
one or more SMA overlays, typically showing short, medium, and long-term
periods (e.g., 20, 50, 200-day). Each SMA line smooths out price
fluctuations by averaging the last N data points, revealing underlying
trends at different time scales. This multi-period overlay is
fundamental to technical analysis, helping traders identify trend
direction, support/resistance levels, and potential crossover signals.
## Applications
- Identifying trend direction by comparing price position relative to
50-day and 200-day SMAs in stock analysis
- Detecting golden cross (50-day crosses above 200-day) and death cross
signals in cryptocurrency trading
- Analyzing short-term momentum versus long-term trend using
20/50/200-day SMA combinations
- Smoothing noisy time series data to reveal underlying patterns in
sensor or metrics monitoring
## Data
- `date` (datetime) - Trading date or timestamp for each period
- `close` (numeric) - Closing price or value for each period
- `sma_short` (numeric) - Short-term SMA (e.g., 20-period)
- `sma_medium` (numeric) - Medium-term SMA (e.g., 50-period)
- `sma_long` (numeric) - Long-term SMA (e.g., 200-period)
- Size: 250-500 periods to show meaningful long-term SMA behavior
- Example: Daily stock closing prices with 20, 50, and 200-day SMAs over
one year of trading
## Notes
- Display the price/close line prominently, typically as a solid line or
with subtle markers
- Each SMA should use a distinct color with consistent styling across
all implementations
- Include a legend showing the period for each SMA (e.g., "SMA 20", "SMA
50", "SMA 200")
- Longer SMAs will have more initial null values due to the calculation
window
- Standard periods are 20/50/200 for daily data, but other combinations
like 10/20/50 are also common
- Grid lines on the y-axis improve price level readability
---
**Next:** Add `approved` label to the issue to merge this PR.
---
:robot: *[spec-create
workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20886473767)*
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent c49f4ab commit 9c63fd9
2 files changed
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments