swma

Symmetrically Weighted Moving Average (fixed 4-period)

swma(source)

Parameters

Name Type Description
source source Data series to calculate SWMA on - price field (close, open, high, low) or indicator output

Formula

```
SWMA = (field + 2*field[1] + 2*field[2] + field[3]) / 6
```
Where weights are: [1/6, 2/6, 2/6, 1/6] (symmetric pattern)

Examples

swma(close);  # 4-period symmetric weighted MA of close
swma(high);   # 4-period symmetric weighted MA of high
x = swma(hl2);  # SWMA of typical (high+low)/2 price

Returns

Symmetrically weighted average value over fixed 4-period window ## References - TradingView: `ta.swma()` ## Notes - Always uses 4 periods (not configurable) - Lighter than WMA/EMA due to fixed calculation - Provides smooth responsive average for short-term analysis