swma
Symmetrically Weighted Moving Average (fixed 4-period)
swma(source)
Calculates a symmetrically weighted moving average with fixed 4-period weights. This uses symmetric weighting [1/6, 2/6, 2/6, 1/6] to emphasize recent data while maintaining balance across the window.
Parameters
- 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
Notes
- Always uses 4 periods (not configurable)
- Lighter than WMA/EMA due to fixed calculation
- Provides smooth responsive average for short-term analysis