Trend & direction

Sine-Weighted Moving Average · SWMA

A weighted average whose weights follow a sine curve, emphasising the middle of the window for a smooth, symmetric filter.

Works in most conditionsEngine-computed on a fixed sample series
14512096Price above WMA 20 = strengthPrice below WMA 20 = weaknessWMA 20 acts as support / resistance
WMA 20How to read SWMA on the chart — the callouts mark what to look for.

The formula

Each bar's weight is the sine of its position across the window, so the middle bars count most and the ends least. Dividing by the sum of the weights keeps it a true average that hugs the centre of the data.

SWMA = Σ(Pᵢ × sin(iπ ÷ (N+1))) ÷ Σ sin(iπ ÷ (N+1))
Worked example
Bar iWeight sin(iπ ÷ 6)
10.50
20.87
31.00
40.87
50.50
Sum3.73

For N = 5 the middle bar carries the most weight and the ends the least.

What the Sine-Weighted Moving Average is

The Sine-Weighted Moving Average (SWMA) is a smoothing filter that averages recent prices using weights shaped like a sine curve, emphasizing the middle of the lookback window rather than the most recent or oldest bars. Where an ordinary weighted moving average puts the heaviest weight on the newest price, the sine-weighted version puts the heaviest weight in the center of the window and tapers off symmetrically toward both ends. The effect is a very smooth, balanced line that is less swayed by any single bar — neither the freshest tick nor the stalest one dominates. It appeals to traders who value a steady, noise-resistant trend line over the fastest possible reaction. For a beginner, think of it as a moving average that trusts the middle of its window most, producing an especially smooth curve at the cost of reacting a little later to fresh moves.

How the SWMA is calculated

For an N-period window, each bar is assigned a weight equal to the sine of its position mapped across a half-cycle — small weights at the first and last positions, rising to a maximum in the center. Concretely, the weight for the i-th bar is the sine of i times pi divided by N plus one, so the weights trace the arch of a sine wave from near zero up to a peak and back down. Each price is multiplied by its weight, the products are summed, and the total is divided by the sum of all the weights to normalize. Because the weighting is symmetric, the center of the window carries the most influence and the two ends carry the least. This is what distinguishes it from a front-weighted average, where the newest bar always dominates.

Reading the SWMA, step by step

Read the SWMA exactly as you would any moving average — through its slope and its relationship to price. A rising SWMA with price above it indicates an uptrend, a falling one with price below indicates a downtrend, and a flat line means no trend. Because its weighting is centered rather than front-loaded, the line is smoother and a touch more lagging than a standard weighted or exponential average, so it filters noise well in gently trending markets. Crossovers of price and the SWMA, or of two SWMAs of different lengths, carry the usual trend-change meaning but arrive slightly later. The smoothness makes it good for reading the underlying drift of a noisy series without being whipped around by individual bars. Its calm slope is its most useful feature.

Reading the signals on the chart

14512096
WMA 20The ▲/▼ marks flag where price most recently crossed the line — the cues a trend-follower would act on.

Best timeframes

  • Scalping1m – 5mreacts late
  • Day trading5m – 15m
  • Swing1H – daily
  • PositionDaily – weekly

The SWMA is a smoothing layer, not a fast trigger — its centre weighting means it filters noise well but reacts late to fresh moves.

SWMA vs other averages

SWMASMAWMA
Weight shapeSine (centre)EqualLinear (recent)
Heaviest barMiddleNoneNewest
CharacterSmooth, symmetricBaselineFront-weighted

Common price-action setups

How the signal typically plays out on the chart.

Slope cross

Price crosses above a turning-up SWMA — buy the cross as the smoothed trend flips up, with a stop back below the line.

Buy the cross
Uptrend begins
Pullback to the line

In a gentle uptrend, price dips to the rising SWMA and holds — buy the bounce, stopping on the far side of the line.

Buy the pullback
Trend continues
Slope cross down

Price crosses below a turning-down SWMA — sell the cross as the smoothed trend rolls over, stop above the line.

Sell the cross
Downtrend begins

Best timeframes and settings

The SWMA suits swing and position trading on daily and higher timeframes, where its smoothness turns a noisy series into a readable trend, and it can be used intraday as a de-noising layer. There is one main parameter — the lookback length — and the usual trade-off applies: a shorter window is more responsive but less smooth, a longer window smoother but more lagging. Because the centered weighting already down-weights the newest bar, the SWMA is inherently slower than a same-length EMA, so pushing the length too high makes it sluggish at real turns. It is often used not as a primary signal line but as a smoothing pass over a series before applying other logic. Traders who prize a steady line over speed favor it precisely for this reason.

When and where to use it

The SWMA is best in gently trending or moderately noisy markets, where its symmetric smoothing cleans up the tape without lagging catastrophically. It is a poor choice for catching sharp breakouts, because down-weighting the most recent bar delays its response exactly when speed matters most. It applies to any liquid instrument and is asset-agnostic since it only needs a price series. Avoid relying on it in fast, news-driven markets or for breakout timing, where its built-in lag is a liability. The regime it serves is a steady trend or a choppy series that needs smoothing, not a volatile one demanding instant reaction.

Strategies that use the SWMA

A trend-smoothing strategy uses the SWMA as the trend filter — trading only long while price holds above a rising SWMA and only short below a falling one — accepting slightly late entries in exchange for fewer false trend calls. A crossover strategy pairs a shorter and a longer SWMA, going with the direction of the cross, and benefits from the smoothness that reduces the whipsaw crossovers a jumpier average would produce. A pre-smoothing strategy applies the SWMA to a noisy input series, or even to another indicator, before acting on crossovers, cleaning up the signal first. In each case the SWMA's role is to provide a stable directional read, with entries confirmed by structure or a faster tool since the SWMA itself will not be quick.

Combining the SWMA with other indicators

Because the SWMA lags, it pairs well with a faster, more responsive tool that handles timing — a shorter EMA or a momentum oscillator — while the SWMA supplies the steady trend context. Support and resistance levels give its slower signals a price reason to act. A volatility measure such as ATR helps size stops around a line that will not react instantly to a spike. It complements front-weighted averages nicely: plotting an SWMA alongside an EMA of the same length shows the difference between a centered, smooth read and a fast, reactive one, and their crossovers can frame a trend. It is best used as the calm anchor in a pairing, not as the trigger.

Where the SWMA fails

The SWMA's central weakness is the very lag its design creates — by down-weighting the newest bar, it reacts late to fresh moves, so at a sharp breakout or reversal it trails badly and gives up part of the move. Like all symmetric smoothers, it is a poor breakout tool and will keep you out of, or late to, fast new trends. Traders who expect it to behave like a fast EMA are repeatedly disappointed by its delay. In violent, gapping markets its smoothness becomes sluggishness. The way to avoid these failures is to use it for what it is — a steady trend-smoothing line — and to pair it with a faster instrument for timing rather than asking it to catch quick moves it was never built to catch.

A worked example

Suppose a trader plots a 20-period SWMA on a daily chart of a moderately choppy stock. Because the weights peak in the middle of the 20-bar window, a single sharp up-day near the current bar barely nudges the line, whereas the same day would jerk a 20-period EMA noticeably higher. Over a two-week gentle uptrend the SWMA rises in a smooth, almost straight slope while price wiggles above and below a faster EMA, and the SWMA never once whipsaws. When a brief three-day pullback hits, the SWMA keeps rising because the middle of its window is still dominated by the prior advance, so it does not flip the trader out of the trend. The cost appears later: when the stock finally tops and reverses hard, the SWMA takes several extra bars to roll over compared with the EMA, so the trader exits a bit late. The example shows the SWMA's bargain — exceptional smoothness and few false signals, paid for with lag at the turns.

Common mistakes

  • Expecting fast breakout signals from a centre-weighted smoother — it lags by design.
  • Using it as a standalone trigger in choppy tape, where its crosses come late.
  • Choosing too long an N, which buries recent moves under the middle weighting.
  • Treating it as a leading indicator rather than a smoothing filter.
  • Ignoring that the newest bar is deliberately under-weighted, delaying reaction.