SimpleMovingAverage
class backtide.indicators.SimpleMovingAverage(period=14)
Simple Moving Average (SMA).
The arithmetic mean of the last n closing prices. Used to smooth short-term fluctuations and identify the direction of a trend. Useful for trend identification, support/resistance levels, and crossover strategies (e.g., golden cross / death cross).
Formula:
\[SMA_t = \frac{1}{n} \sum_{i=0}^{n-1} C_{t-i}\]
where \(C_t\) is the closing price at time \(t\) and \(n\) is the period. Read more on Wikipedia.
| Parameters |
Look-back window length.
|
| Attributes |
Short ticker-style acronym.
name : str
Human-readable indicator name.
|
See Also
Bollinger Bands (BB).
Exponential Moving Average (EMA).
Weighted Moving Average (WMA).
Methods
| compute | Compute the indicator on a dataset. |
| description | Short explanation of what the indicator measures. |
method backtide.indicatorscompute(data)
Compute the indicator on a dataset.
method backtide.indicatorsdescription()
Short explanation of what the indicator measures.
| Returns |
str
The description.
|