Dalal Street Blogs provides information for educational purposes only and does not constitute investment advice. Please consult a SEBI-registered investment adviser before making any investment decisions.
CAUTION: Dalal Street Blogs publishes market news and educational content only. We do not promote, recommend or endorse any stock, and nothing here is a solicitation to buy or sell securities. Please consult a SEBI-registered adviser before investing.
Technical Analysis

Arnaud Legoux Moving Average: Offset, Sigma and How the Gaussian Line Works

calculator and pen on desk for Arnaud Legoux moving average study

Photo: calculator by Edar, Pixabay Content License via Pixabay

By Dalal Street Blogs Editorial9 min read

Every moving average asks you the same uncomfortable question: how much lag are you willing to live with for a cleaner line? A simple average is honest but slow. An exponential one reacts faster and then overshoots when price snaps back. The Arnaud Legoux moving average, or ALMA, was built as a third option. It uses a Gaussian bell of weights, slides that bell toward the newer bars, and tries to stay smooth without chasing every tick. In this guide we unpack the formula, walk through a worked example with clear illustrative numbers, and talk about how we’d actually read it on an Indian stock or index chart.

In this article
  1. Where the Arnaud Legoux moving average came from
  2. How the Arnaud Legoux moving average formula works
  3. Worked example with illustrative numbers
  4. What offset and sigma actually change on a chart
  5. How we’d use ALMA on Indian market charts
  6. Where ALMA trips people up
  7. ALMA versus SMA and EMA in one glance
  8. A practical checklist before you lean on ALMA
  9. Bottom line

Where the Arnaud Legoux moving average came from

ALMA was created in 2009 by Arnaud Legoux and Dimitrios Kouzis-Loukas. Their original site, still preserved on the Internet Archive, describes it as a moving average meant for intraday traders who were tired of the usual SMA and EMA kit. The early write-up talks about applying a filter left-to-right and then right-to-left to cut phase shift, the lag that conventional smoothers add when they kill noise.

The form that actually landed in charting libraries is simpler to inspect. It is a finite-window weighted average whose weights follow a Gaussian curve. The R package TTR documents ALMA(x, n = 9, offset = 0.85, sigma = 6) and notes that it is “inspired by Gaussian filters” and “tends to put less weight on most recent observations, reducing tendency to overshoot.” TradingView’s help centre lists the same defaults: window 9, offset 0.85, sigma 6.

So when someone on TradingView or in a Python notebook drops an ALMA on Nifty or a mid-cap stock, they are almost certainly looking at a nine-bar Gaussian average with the peak sitting about 85% of the way toward the newest bar, and a fairly tight bell around that peak.

ALMA is not a magic average. It is a Gaussian window with two dials — offset and sigma — that decide how recent and how concentrated the weights are.

How the Arnaud Legoux moving average formula works

Index the bars inside the lookback from 0 (oldest) to n − 1 (newest). Three steps build the weights:

  • Peak position: m = offset × (n − 1)
  • Spread: s = n / sigma
  • Weight for bar i: w[i] = exp( −(i − m)² / (2 × s²) )

Then ALMA is the usual weighted average:

ALMA = (sum of w[i] × price[i]) / (sum of w[i])

That is the continuous-peak form used in most educational write-ups and in libraries such as TTR. Some charting code rounds m down to a whole bar before building the Gaussian, which can matter on very short windows; at the default length of 9 the difference is small. Either way, the idea is the same.

Two things stand out once you stare at the formula.

First, offset is a fraction between 0 and 1. At 0.5 the peak sits in the middle of the window and ALMA behaves a lot like a smooth SMA. At 0.85 — the default — the peak sits near the recent end, so the line turns faster. Push it to 1.0 and almost all the weight piles on the newest bar, which cuts lag further but also cuts the smoothing you came for.

Second, sigma works the opposite way many people expect. Because s = n / sigma, a larger sigma makes a narrower bell. At the default sigma of 6 on a nine-bar window, s is 1.5 bars. Most of the weight sits on a handful of recent bars; the oldest ones barely matter. Drop sigma toward 2 or 3 and the weights flatten toward a simple average. TradingView notes that the default of 6 is inspired by the Six Sigma idea and recommends leaving it alone unless you have a clear reason to change it.

Worked example with illustrative numbers

Let’s calculate one ALMA value by hand so the weights stop feeling abstract. These are made-up closes for an imaginary stock. They are teaching numbers, not market data.

Bar index i (0 = oldest)Close (Rs)
0100
1101
2102
3103
4104
5105
6106
7108
8110

Defaults: n = 9, offset = 0.85, sigma = 6.

  • m = 0.85 × 8 = 6.8
  • s = 9 / 6 = 1.5

Weights (rounded to six decimals):

iPriceWeight w[i]
01000.000034
11010.000567
21020.005976
31030.040401
41040.175131
51050.486752
61060.867428
71080.991151
81100.726149

Sum of weights ≈ 3.2936. Weighted sum of prices ≈ 353.02. ALMA ≈ 107.18.

A plain 9-bar SMA of the same window is (100+101+…+110) / 9 = 104.33. Price has climbed from 100 to 110, so the SMA still sits near the middle of that climb. ALMA sits much closer to the recent highs because bars 6, 7 and 8 dominate the weights. Notice also that the newest bar (110) does not get the single biggest weight — bar 7 does, because the peak is at 6.8. That is the overshoot control TTR is talking about. The line leans recent without treating the last print as gospel.

With default settings, most of ALMA’s weight sits on a few recent bars, but not on the very last one alone. That is the whole design bet.

What offset and sigma actually change on a chart

Once the formula is clear, the two knobs become practical.

Offset toward 1.0 — faster turns, more noise. Useful if you are timing entries on a 5-minute or 15-minute Nifty chart and already have a separate trend filter. Dangerous if you treat every ALMA cross of price as a signal.

Offset toward 0.5 — smoother, more lag. Closer to an SMA of the same length. Fine as a slow regime line on daily charts of large-caps, less useful as a timing tool.

Sigma higher than 6 — narrower bell, sharper reaction around the peak. The average starts to behave like a short weighted average sitting at the offset position.

Sigma lower than 6 — wider bell, more bars matter, closer to SMA behaviour even if offset is high.

In practice we would leave sigma at 6 and only tune length and offset. Length is the big lever. A 9-bar ALMA on a daily chart of a mid-cap is a short swing tool. A 20- or 50-bar ALMA becomes a trend filter. Mixing those two roles on the same pane without labelling them is how people end up arguing with their own chart.

How we’d use ALMA on Indian market charts

1. As a low-lag trend line, not as a crystal ball

Plot ALMA(9, 0.85, 6) on a liquid stock or on Nifty 50. When price holds above a rising ALMA for several sessions, the short-term balance of prices is still skewed recent and up. When price closes clearly below a falling ALMA, that balance has flipped. Treat those states as context, the way you would treat a well-chosen EMA, not as automatic buy and sell orders.

2. Pair it with a slower average or a regime filter

One clean setup is a fast ALMA for timing and a slower SMA or EMA for direction. Take long ideas only when price and the fast ALMA are both above the slow average. That is the same spirit as a classic moving average crossover strategy, just with a Gaussian short leg instead of a second EMA. You can also borrow a momentum confirmation from something like the MACD-V histogram so you are not buying every bounce in a weak tape.

3. Respect structure before the indicator

ALMA does not know where your support and resistance are. A bullish reclaim of ALMA right under a heavy supply zone is a weaker setup than the same reclaim after a clean bounce from demand. Mark the levels first. Our technical analysis guide for Indian stocks walks through that order of work.

4. Prefer liquid names and sensible timeframes

On thin small-caps, a nine-bar ALMA will twitch with every wide spread. On Bank Nifty futures or a large-cap like HDFC Bank or Infosys, the same settings are more readable. Intraday, try it on 5-minute or 15-minute bars only after you have watched a few full sessions without trading it. Daily charts are the kinder place to learn the line.

5. Compare, don’t worship

ALMA sits in the same family of “try to reduce lag without exploding noise” tools as Hull moving averages and zero-lag EMAs. The R TTR docs list ALMA next to HMA and ZLEMA for a reason. Run ALMA and a plain EMA of similar visual lag on the same pane for a month. If you cannot tell which one would have saved you money after costs and slippage, keep the simpler one.

Where ALMA trips people up

  • Extra parameters invite overfitting. Length, offset and sigma give you a lot of room to curve-fit last quarter’s Nifty swings. Fix sigma at 6, pick one length per timeframe, and stop tweaking.
  • It still lags real turns. In our illustrative climb from 100 to 110, ALMA printed about 107, not 110. Smoothness is not foresight.
  • Range markets chop it up. When price oscillates around a flat ALMA, crosses fire both ways. Add a volatility or range filter, or simply stand aside.
  • Library differences. Some platforms floor the peak position; others keep the fractional m. On short windows the lines diverge. Check which implementation your broker chart uses before you copy settings from a blog screenshot.
  • It is not a substitute for risk rules. A pretty average does not size your position or place your stop. That still belongs to a separate process — see our notes on risk management in trading.

ALMA versus SMA and EMA in one glance

A simple moving average weights every bar equally, so its “centre of gravity” sits in the middle of the window. That is why an SMA of length n feels about n/2 bars late. An EMA decays forever into the past with more weight on the newest bar, which is responsive but can overshoot when the newest bar is an outlier. ALMA keeps a hard window like the SMA, then piles Gaussian weight near a chosen point inside that window. You get something between the two classics, with the trade-off exposed as offset and sigma instead of buried inside a single smoothing constant.

If you already think in terms of where weight sits inside a window, the center of gravity oscillator is a useful neighbour: it tracks that balance point as an oscillator rather than as a smoothed price line.

A practical checklist before you lean on ALMA

  1. Decide the job: short timing line, or slow trend filter. Do not ask one length to do both.
  2. Start with defaults — n = 9, offset = 0.85, sigma = 6 — on a daily chart of a liquid stock or index.
  3. Leave sigma alone until you understand what the line is doing.
  4. Add one slower average or a clear market-structure rule as a filter.
  5. Paper-trade the crosses for a few weeks. Count false signals in sideways weeks, not only winners in trending weeks.
  6. Write down the exact settings and the platform, because ALMA is not identical everywhere.

None of this turns ALMA into a complete system. It turns it into a tool you understand well enough to trust or discard on purpose.

Bottom line

The Arnaud Legoux moving average is a Gaussian-weighted window with the peak shifted toward recent prices. Defaults of 9, 0.85 and 6 are the common starting point in both TTR and TradingView. Offset controls lag versus smoothness; sigma controls how sharp the bell is, and larger sigma means a narrower bell. Used with structure, a trend filter and ordinary risk rules, it can be a cleaner short-term average than a raw EMA of similar speed. Used alone as a buy-sell machine, it will chop you up in ranges just like every other average.

This article is for education only and is not investment advice. Moving averages, including ALMA, lag price and can give false signals. Do your own research and consider speaking with a SEBI-registered adviser before acting on any chart setup.

Leave a Reply

Join the conversation

Commenting is open to registered readers. Sign up with just your email — no password needed, and it takes under a minute.

Sign up to comment Log in