# Sine-weighted MA

Plots a moving average whose weights trace half a sine cycle across a 20-bar window, tapering to near zero at both edges for a visibly calmer line. Slope-based trend coloring, a gradient fill against price and an optional 10-bar fast SWMA crossover pair are built in, with a dashboard quoting the window's half-length lag. For traders who value smoothness over early turns.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Mar 22, 2026.
- Access: free.
- Concepts: [Sine-weighted MA](https://www.luxalgo.com/library/concept/sine-weighted-ma/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=t16ns0feycr3hlhesny141nb
- Page: https://www.luxalgo.com/library/indicator/sine-weighted-ma/

**Sine-weighted MA** draws the half-sine-windowed smoother as a single slope-colored line with an optional faster companion, the definitive clean take on the [sine-weighted moving average](https://www.luxalgo.com/library/concept/sine-weighted-ma/). Weights peak mid-window and fade toward zero at both ends, so bar-to-bar jitter is heavily damped and the slope flips rarely; the cost is delay of about half the window, which the dashboard quotes exactly as (N − 1) / 2 bars.

## How to Trade the Sine-weighted MA?

- **Slope color**: the line paints bullish while rising and bearish while falling, the low-jitter trend read this weighting exists for.
- **Price side of the line**: the gradient fill leans bullish while the source holds above the SWMA and bearish below it, the second classic baseline read.
- **Fast SWMA crossings**: with the pair enabled, the 10-bar line crossing the 20-bar baseline gives steadier crossover legs than equal-weighted averages of the same lengths.

It earns its keep among the [trend-following toolkit](https://www.luxalgo.com/library/family/trend/)'s slower lines wherever dodging whipsaw is worth more than an early entry: as a pair's slow leg, a slope filter, or a pre-smoothing stage feeding other studies.

## Sine-weighted MA Settings

- **Source** (default close): the series the average smooths.
- **Length** (default 20): window size N; each bar is weighted by sin(π(i+1)/(N+1)), so raising it buys smoothness at the price of roughly half a window of extra delay.
- **Fast SWMA** (default off) and **Fast SWMA Length** (default 10): the crossover companion; keep it shorter than the main length.
- **Show Dashboard** (default on): length, lag, slope and price position at a glance.
- Style: **Slope Trend Coloring** (default on), **Price / SWMA Gradient Fill** (default on), **Price Crossing Markers** (default off), **Line Width** (default 2). These control presentation only.

## Frequently Asked Questions

### What sets it apart from a standard moving average?

An [equal-weighted moving average](https://www.luxalgo.com/library/indicator/moving-average/) ends its window abruptly, and that sharp cutoff lets stray wiggle through into the plotted line. The half-sine taper suppresses that leakage, so at the same length the SWMA draws calmer output in the same general lag class.

### How much lag should I expect?

About (N − 1) / 2 bars, 9.5 at the default 20, because emphasis sits mid-window. The dashboard reports the figure for both lines. If catching turns early is the goal, this weighting is deliberately the wrong pick.

### What alerts are available?

Six: price crossing above or below the SWMA, the slope turning up or down, and, with the pair enabled, the fast SWMA crossing the slow one in either direction.

## Related indicators

- [Trend Regularity Adaptive Moving Average](https://www.luxalgo.com/library/indicator/trend-regularity-adaptive-moving-average/) (TRAMA): markdown at https://www.luxalgo.com/library/indicator/trend-regularity-adaptive-moving-average.md
- [Machine Learning Moving Average](https://www.luxalgo.com/library/indicator/machine-learning-moving-average/) (Adaptive-lookback MA): markdown at https://www.luxalgo.com/library/indicator/machine-learning-moving-average.md
- [ZLEMA](https://www.luxalgo.com/library/indicator/zlema/) (Trend): markdown at https://www.luxalgo.com/library/indicator/zlema.md
- [Moving Average Converging](https://www.luxalgo.com/library/indicator/moving-average-converging/) (EMA): markdown at https://www.luxalgo.com/library/indicator/moving-average-converging.md
- [MLMA](https://www.luxalgo.com/library/indicator/mlma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/mlma.md
- [Volume-adjusted MA](https://www.luxalgo.com/library/indicator/volume-adjusted-ma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/volume-adjusted-ma.md
- [JMA](https://www.luxalgo.com/library/indicator/jma/) (Trend): markdown at https://www.luxalgo.com/library/indicator/jma.md
- [T3](https://www.luxalgo.com/library/indicator/t3/) (Trend): markdown at https://www.luxalgo.com/library/indicator/t3.md

---

Source: https://www.luxalgo.com/library/indicator/sine-weighted-ma/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
