The Platform for Leveraged ETF Strategies
Follow your strategy. Not your emotions.
Strategies · SMA trend following

SMA stands for simple moving average.

Read from the start: chapter 1 The Rule

Leveraged ETFs can lose a large part of their value in a short time.

Chapter 10 of 13

Math

The moving average over a window of length nn is the mean of the last nn closing levels:

SMAn(t)=1n∑i=0n−1P(t−i)\mathrm{SMA}_n(t) = \frac{1}{n} \sum_{i=0}^{n-1} P(t-i)

The window counts closing levels, that is trading days, not calendar days. The difference is substantial: a year has just under a third fewer trading days than calendar days. The same number means a markedly different window in each counting, and values from other analyses are comparable only if the counting is the same.

Buffer

The state condition with buffers reads separately for entry and exit, with the buffers binb_{\text{in}} and boutb_{\text{out}} as a share of the line:

risk_on:P(t)>SMAn(t) (1+bin)\text{risk\_on}: \quad P(t) > \mathrm{SMA}_n(t)\,\bigl(1 + b_{\text{in}}\bigr) risk_off:P(t)<SMAn(t) (1−bout)\text{risk\_off}: \quad P(t) < \mathrm{SMA}_n(t)\,\bigl(1 - b_{\text{out}}\bigr)

Between the two thresholds the previous state persists. That intermediate zone is the whole point of the buffer: without it the two conditions coincide, and every touch of the line produces a switch. Confirmation days kk tighten the condition in time: it has to hold on kk consecutive trading days before the state changes.

Why the filter is connected to leverage at all is shown by the volatility drag. A product with daily leverage LL tracks LL times the daily return. For the mean continuous growth rate gLg_L with drift μ\mu and volatility σ\sigma, approximately:

gL≈Lμ−L2σ22g_L \approx L\mu - \frac{L^2\sigma^2}{2}

For the unleveraged case g1≈μ−σ2/2g_1 \approx \mu - \sigma^2/2. Substituting leaves, for twofold leverage:

g2≈2g1−σ2g_2 \approx 2g_1 - \sigma^2

Leverage therefore does not double the growth rate; it additionally subtracts a term that grows with the square of volatility. That is why a leveraged product is cheap in calm rising phases and expensive in turbulent ones, and why a filter that avoids the turbulent phases matters more for leveraged holdings than for unleveraged ones. This is the arithmetic core behind the argument of Gayed and Bilello, who show the same relationship empirically, through volatility above and below the average. The approximation itself is not in their paper; it comes from the literature on leveraged products, among others from Double-Digit Numerics.

What this means for the rule itself follows from the same approximation, because the continuous growth rate adds up over the days. Split the trading days by the state of the rule: on a share qq of the days it is out, on the rest it is invested. μout\mu_{\text{out}} and σout\sigma_{\text{out}} are the drift and volatility of the index on the days out, μin\mu_{\text{in}} and σin\sigma_{\text{in}} on the others, both measured from daily returns and annualised; rr is the continuous interest rate the money earns while out. Holding throughout grows at

ghold≈q(Lμout−L2σout22)+(1−q)(Lμin−L2σin22)g_{\text{hold}} \approx q\Bigl(L\mu_{\text{out}} - \frac{L^2\sigma_{\text{out}}^2}{2}\Bigr) + (1-q)\Bigl(L\mu_{\text{in}} - \frac{L^2\sigma_{\text{in}}^2}{2}\Bigr)

The rule swaps the first term for the interest rate:

grule≈q r+(1−q)(Lμin−L2σin22)g_{\text{rule}} \approx q\,r + (1-q)\Bigl(L\mu_{\text{in}} - \frac{L^2\sigma_{\text{in}}^2}{2}\Bigr)

The difference therefore depends only on the days out:

grule−ghold≈q(r−Lμout+L2σout22)g_{\text{rule}} - g_{\text{hold}} \approx q\Bigl(r - L\mu_{\text{out}} + \frac{L^2\sigma_{\text{out}}^2}{2}\Bigr)

Three things follow. First, the rule lowers the volatility term, averaged over the whole period, from qσout2+(1−q)σin2q\sigma_{\text{out}}^2 + (1-q)\sigma_{\text{in}}^2 to (1−q)σin2(1-q)\sigma_{\text{in}}^2. It lowers it by a larger fraction than its time share qq only if the days out are more volatile than the others, that is σout>σin\sigma_{\text{out}} > \sigma_{\text{in}}. Second, it pays for this with the drift of those days: the rule is ahead only if the leveraged product would have grown more slowly than the interest rate on the days out, that is Lμout−L2σout2/2<rL\mu_{\text{out}} - L^2\sigma_{\text{out}}^2/2 < r. If being out is random, unrelated to both drift and volatility, the days out on average look like the average; then the rule is ahead only if holding itself grows more slowly than the interest rate, and otherwise it trades growth for interest. Third, inside the bracket the volatility term grows with L2L^2, the drift only with LL. Above L=μout/σout2L = \mu_{\text{out}}/\sigma_{\text{out}}^2 the bracket grows with leverage; if the drift on the days out is zero or negative, this holds for any leverage. So the same days out can give the twofold leveraged product a lead where they give the index none. This is the relationship from g2g_2, shown on the rule itself. Because the days are split by the position held, not by the signal day, the delay after a signal is already contained in the split; trading costs of the switches are missing from the calculation. Whether a moving average is actually out during the volatile phases is not something it tells you; only the data show that.

Day by day

The website applies the rule day by day, each time at the closing price (Close).

What is computed is one buffer bb for both directions, one confirmation day and the comparison with ≥\ge; the separate buffers binb_{\text{in}} and boutb_{\text{out}} and the confirmation days kk above are the general form.

The line depends on the state of the previous day. If the index was in, it lies one buffer below the average; if it was out, one buffer above; on the first day with a full line the average itself applies:

L(t)={SMAn(t) (1−b)previous day inSMAn(t) (1+b)previous day outL(t) = \begin{cases} \mathrm{SMA}_n(t)\,(1 - b) & \text{previous day in} \\ \mathrm{SMA}_n(t)\,(1 + b) & \text{previous day out} \end{cases}

Whether the money is in the market is decided by comparing index and line: P(t)≥L(t)P(t) \ge L(t)

When the result changes, that is a crossing (Cross) of the line, and the entry or the exit follows at the same closing price. Line and money follow the same comparison; rounding is done only for the display. Every entry and every exit costs the share cc of the value WW:

W←W (1−c)W \leftarrow W\,(1 - c)

While out, the money earns the daily money-market rate on every trading day with a product price. rr is the last known rate in percent per year, 2.5 % without a known rate; a negative rate counts as 0:

z=(1+max⁡(r,0)/100)1/252−1z = \bigl(1 + \max(r, 0)/100\bigr)^{1/252} - 1

On the entry day the money still earns interest, on the exit day it no longer does. The start decision on the first day with a full line costs nothing and does not count as a trade.

Chapter 11 of 13Recompute