# SWMA

Also known as: symmetric weighted MA.
A Trend concept (Moving-average lineage) in the LuxAlgo Library, with 1 indicator implementation.

## What is the SWMA?

The SWMA, or symmetric weighted moving average, is a moving average whose weights are mirrored around the center of its window. In the form most traders meet it (the built-in found in popular charting platforms), it is a fixed four-bar average with weights 1/6, 2/6, 2/6, 1/6: the two middle bars count double, the two outer bars count single, and the weights sum to one. More broadly, the term covers any finite moving average with center-symmetric weights, a family that also includes the [triangular MA](https://www.luxalgo.com/library/concept/triangular-ma/) and the [sine-weighted MA](https://www.luxalgo.com/library/concept/sine-weighted-ma/).

The symmetry is not cosmetic; it is the defining engineering property. A symmetric finite-impulse-response filter has exactly linear phase, meaning every frequency component it passes is delayed by the same fixed amount, (n - 1) / 2 bars for a window of n. The smoothed line is therefore an undistorted, uniformly shifted copy of the low-frequency content of price. Recursive averages like the [EMA](https://www.luxalgo.com/library/concept/ema/) cannot make that claim: they delay slow swings and fast wiggles by different amounts, subtly warping the shape of moves.

Traders care about the four-bar SWMA mostly as a fast, cheap noise reducer. With a delay of exactly 1.5 bars it barely lags, and its double-weighted center suppresses single-bar spikes better than a plain four-bar [SMA](https://www.luxalgo.com/library/concept/sma/). It is common as a pre-smoothing stage inside composite indicators rather than as a standalone signal line, since four bars of smoothing is far too little to define a trend by itself.

## How it's calculated

The standard fixed-length form uses four bars with symmetric weights summing to one:

```
SWMA_t = (1*C_(t-3) + 2*C_(t-2) + 2*C_(t-1) + 1*C_t) / 6

  t: current bar index
  C_t: source value at bar t, usually close (offsets are that many bars earlier)
  SWMA_t: symmetric weighted moving average at bar t
```

This 1-2-2-1 weighting over four bars is the common charting-platform implementation and takes no length input.

Generalized symmetric versions use any mirrored weight profile over n bars; all share a constant delay of (n - 1) / 2 bars.

Because the window is symmetric, applying the weights forward or backward gives the identical result.

## How traders use it

- As a pre-filter: smoothing the input of an oscillator or a longer average with the four-bar SWMA knocks out one-bar spikes at a cost of only 1.5 bars of delay, often cleaning signals more than it slows them.
- As a gentler price proxy in bar-by-bar logic: rules that compare consecutive closes can compare consecutive SWMA values instead, reducing sensitivity to single aberrant prints.
- Longer symmetric weightings are chosen when downstream logic measures swing shape or timing, because the uniform delay of symmetric filters preserves waveform geometry; see also [windowed FIR smoothing](https://www.luxalgo.com/library/concept/windowed-fir-smoothing/) for the general design approach.
- Its limitation is scope: four bars of smoothing does not filter regime noise, and the fixed length offers no tuning. It removes texture, not chop, and should not serve as a trend filter on its own.

## SWMA vs neighboring weighted averages

- **WMA** (https://www.luxalgo.com/library/concept/wma/): The WMA weights bars linearly toward the most recent, deliberately asymmetric to cut lag. The SWMA's mirrored weights accept a fixed centered delay in exchange for distortion-free smoothing.
- **Triangular MA** (https://www.luxalgo.com/library/concept/triangular-ma/): The triangular MA is the length-adjustable member of the same symmetric family, with weights rising linearly to the window center. The common SWMA is essentially a compact fixed four-bar relative.
- **Sine-weighted MA** (https://www.luxalgo.com/library/concept/sine-weighted-ma/): The sine-weighted MA shapes its symmetric weights with a half sine wave, giving a smoother rolloff of the window edges. Same linear-phase property, different weight profile and selectable length.

## FAQ

### Why does the SWMA have no length setting?

The common implementation hard-codes the four-bar 1-2-2-1 window. Generalized symmetric averages with adjustable length exist, but the well-known built-in is fixed by definition.

### What does symmetric actually buy me?

A constant delay for everything the filter passes: 1.5 bars for the four-bar version. The smoothed line is a shifted copy of the slow content of price rather than a shape-distorted one.

### Is the SWMA a trend indicator?

Not by itself. Four bars of smoothing removes single-bar noise, nothing more. It is best treated as a hygiene layer under other tools, not as a trend filter.

### How does it differ from just using a 4-bar SMA?

The SMA weights all four bars equally, so an outlier at the window edge moves it as much as one in the middle. The SWMA's double-weighted center makes it slightly smoother against edge spikes at the same length.

## Implementations in the Library

- SWMA (LuxAlgo): https://www.luxalgo.com/library/indicator/swma/

## Related concepts

- SMA: https://www.luxalgo.com/library/concept/sma/
- EMA: https://www.luxalgo.com/library/concept/ema/
- Adaptive-lookback MA: https://www.luxalgo.com/library/concept/adaptive-lookback-ma/
- MA Envelope: https://www.luxalgo.com/library/concept/ma-envelope/
- RMA: https://www.luxalgo.com/library/concept/rma/
- HMA: https://www.luxalgo.com/library/concept/hma/
- KAMA: https://www.luxalgo.com/library/concept/kama/
- JMA: https://www.luxalgo.com/library/concept/jma/
- ZLEMA: https://www.luxalgo.com/library/concept/zlema/
- T3: https://www.luxalgo.com/library/concept/t3/

---

Source: https://www.luxalgo.com/library/concept/swma/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/