Part 2: The indicators one by one · Chapter 2 of 14 · 9 min

Moving averages: SMA, EMA and crossovers

The formulas of the simple (SMA) and exponential (EMA) moving averages, what price does after a close above or below the average, after a crossover with price and between two averages, and three always-in-the-market systems with cost: +433 to +678 dollars per ounce, but with 32-37% winning trades and a comparison with random flips that equals them 26-32% of the time.

The formulas

The simple moving average (SMA) of N periods is the average of the last N closes. The exponential moving average (EMA) gives more weight to recent closes: today's EMA = k × close + (1 − k) × yesterday's EMA, with k = 2 ÷ (N + 1). For N = 20, k is 0.095.

An average is the mean price of a period: it sits below price in a rise, above it in a fall, and the delay grows with N. It is used in three ways: as a state (the close is above or below), as a crossover with price (the close goes to the other side) and as a crossover between two averages (the fast one passes the slow one).

The state: above or below the average

Every H4 candle with the average defined is a signal: a close above = "up", below = "down". We look at whether over the next 10 candles price first reaches +1.5 ATR or −1.5 ATR in the direction of the signal. The benchmark with any candle gives: "up" carries on 36% (mean move −0.06 ± 0.08 ATR), "down" carries on 40% (+0.06 ± 0.08).

EMAAbove: signals, carries on, mean moveBelow: signals, carries on, mean move
10905, 39%, +0.15 ± 0.11825, 45%, +0.28 ± 0.12
20902, 39%, +0.23 ± 0.11828, 44%, +0.37 ± 0.12
50808, 39%, +0.13 ± 0.11903, 43%, +0.35 ± 0.11
100746, 38%, +0.26 ± 0.11915, 42%, +0.36 ± 0.11
200636, 36%, +0.19 ± 0.11925, 42%, +0.43 ± 0.12

Simple averages give very close numbers (SMA 50: above 38% and +0.18, below 42% and +0.41). Above the average price carries on like the benchmark (36-39% against 36%). Below the average it carries on 42-45% against 40%. The mean move over 10 candles in the direction of the average is between +0.13 and +0.43 ATR, against ±0.06 for the benchmark: a weak tendency in the direction of the average. The signals of neighboring candles overlap (each sees the same 10 candles as the next), so the number of independent cases is about a tenth of the one written and the real error is about three times larger.

The crossovers

Price and average. A close that goes above the EMA 20 is an "up" signal: 84 cases, it carries on 26% (±9 points) and reverses 46%. On the downside, 85 cases: it carries on 59% (±10), reverses 18%. With the EMA 50: upward 53 cases (34% and 43%), downward 54 (48% and 31%). With the EMA 100: 42 and 42 cases, 33% and 36%. In the period, largely falling, the downside carried on and the upside reversed.

Two averages. The EMA 10/30 cross 54 times (25 upward: carries on 52% ±20; 26 downward: 38% ±19). The EMA 20/50 32 times (14 and 15: 57% and 40%, errors of 25 points), the 12/26 50 times (23 and 24: 48% and 50%), the 50/200 only 10 times. With 14-26 cases per side the error is between 19 and 26 points: no crossover can be told from the benchmark.

A crossover system

The simplest system is always in the market: you buy at the close in which the fast average passes above the slow one, you sell (and open a short) at the close in which it passes below. A cost of 0.30 dollars per ounce on every complete trade.

Figure 1 shows the EMA 20/50 system on H4, from 27 July to 6 August 2026. A long opened on 21 July at $4,085.65 closes on 28 July at 4,031.73 (−54.22 dollars per ounce). The short that follows closes on 30 July at 4,114.74 (−83.31), the long of 1 August at 4,055.21 (−59.83), the short of 2 August at 4,074.64 (−19.73), the long of 3 August at 4,059.00 (−15.94) and the short of 4 August at 4,081.08 (−22.38): six losing trades in a row, −255.41 dollars in all.

Figure 1. False signals: the EMA 20/50 crossover flips the system six times in thirteen days and every trade loses (from −15.94 to −83.31 dollars per ounce).Data: gold, XAUUSDT perpetual future (real candles) · 4 hours (H4) · from 27 Jul 2026 00:00 UTC to 6 Aug 2026 00:00 UTC.
Read the chart in words

H4 gold chart from 27 July to 6 August 2026 with the 20-period average (blue line) and the 50-period one (dashed pink line). Labels mark the crossovers and the result of each trade, all losses.

WhenWhatPrice
27 Jul 2026 00:00 UTCEMA 204,073.27 → 4,151.53
27 Jul 2026 00:00 UTCEMA 504,067.51 → 4,106.40
28 Jul 2026 16:00 UTCdown: trade −54 $4,026.55
30 Jul 2026 12:00 UTCup: trade −83 $4,126.64
1 Aug 2026 08:00 UTCdown: trade −60 $4,054.57
2 Aug 2026 16:00 UTCup: trade −20 $4,076.98
3 Aug 2026 16:00 UTCdown: trade −16 $4,038.20
4 Aug 2026 08:00 UTCup: trade −22 $4,089.97

Times in UTC.

Figure 2 shows the same rule in a long move, from 3 to 31 August. The long opened on 4 August at 4,081.08 stays in the market until the crossover of 29 August at 4,467.23: +385.85 dollars per ounce, more than the sum of the six losses (255.41).

Figure 2. The long move: the long opened at the crossover of 4 August (4,081.08) stays until 29 August (4,467.23) and earns 385.85 dollars per ounce after cost.Data: gold, XAUUSDT perpetual future (real candles) · 4 hours (H4) · from 3 Aug 2026 00:00 UTC to 31 Aug 2026 00:00 UTC.
Read the chart in words

H4 gold chart from 3 to 31 August 2026 with the 20-period average (blue line) and the 50-period one (dashed pink line). Labels mark the crossovers and the result: two small losses and a trade that earns 385.85 dollars per ounce.

WhenWhatPrice
3 Aug 2026 00:00 UTCEMA 204,067.64 → 4,497.00
3 Aug 2026 00:00 UTCEMA 504,066.30 → 4,531.23
3 Aug 2026 16:00 UTCdown: trade −16 $4,038.20
4 Aug 2026 08:00 UTCup: trade −22 $4,089.97
29 Aug 2026 00:00 UTCdown: trade +386 $4,465.15

Times in UTC.

The three systems over the whole history (from late December to September):

SystemTradesWinningMean per tradeTotalRandom flips with total at least equal
EMA 10/305017 (34%)+13.56 ± 21.14 dollars+67826%
EMA 12/264617 (37%)+13.17 ± 22.70 dollars+60627%
EMA 20/50289 (32%)+15.47 ± 29.93 dollars+43332%

Buy and hold in the same period gave from −73 to +5 dollars per ounce. A comparison with random flips (the same number of flips on random candles, alternating long and short, 2,000 trials) has a median total between −104 and −22 dollars and runs from about −1,900 to +1,900 (5th-95th percentile): the systems' totals (+433 to +678) are beaten by chance in 26-32% of trials.

Winning trades are 32-37%, but the few winners are much larger than the losers: it is the profile of a trend-following system. The error per trade (21-30 dollars) is larger than the mean (13-15).

A four-step routine

  1. Choose a single rule (state, crossover with price or crossover between two averages) and write it before looking at the chart.
  2. Count all the trades, including the strings of false signals, and measure the total with cost.
  3. Compare it with random flips of the same number.
  4. Accept that a crossover system wins rarely: you need large trades to pay the small losses.

Exercises

Chapter exercises

1. On the chart the letters sit on the first four crossovers between the EMA 20 and the EMA 50. Which letter is the first upward crossover, the one in which the EMA 20 passes above the EMA 50?

Chart exercise. Data: gold, XAUUSDT perpetual future (real candles) · 4 hours (H4) · from 27 Jul 2026 00:00 UTC to 6 Aug 2026 00:00 UTC.
Read the chart in words
WhenWhatPrice
28 Jul 2026 16:00 UTCPoint A4,026.55
30 Jul 2026 12:00 UTCPoint B4,126.64
1 Aug 2026 08:00 UTCPoint C4,054.57
2 Aug 2026 16:00 UTCPoint D4,076.98

Times in UTC.

2. What is k, the weight of the most recent close, in a 19-period EMA?

3. The EMA 10/30 system gave +678 dollars per ounce over 50 trades, but random flips of the same number do at least as well 26% of the time. What do you conclude?

4. The EMA 20/50 system wins 32% of trades but has a positive mean (+15.47 dollars). How is that possible?

Have a question or want to share your exercise?

Post in the community, or join the free signals room on Telegram.

Educational content, not financial advice. Trading involves risk.