WMA Crossover Strategy: How to Build It in Arrow Algo

WMA Crossover Strategy: How to Build It in Arrow Algo

Every WMA crossover strategy makes the same bet: that a weighted moving average will turn a bar or two before a simple one, and that those bars are worth having. The Weighted Moving Average, or WMA, gives the newest candle the most influence and the oldest candle the least. Cross a fast WMA over a slow WMA and you get the classic trend-following signal, delivered earlier than the SMA version. Our Weighted Moving Average guide covers the indicator itself. This post is about the crossover rules and how to test them.

Why Weight the Average Before You Cross It?

A Simple Moving Average treats every bar in its window equally. On a 20-period SMA, the candle from 20 bars ago matters as much as the one that just closed. That is why SMA crossovers arrive late. The average is anchored to old prices.

The WMA fixes this with a linear weighting. On a 20-period WMA the latest close gets a weight of 20. The one before it gets 19. The oldest gets 1. Investopedia’s weighted average explainer walks through the arithmetic. The result tracks current price more closely than the SMA. It is also smoother than price itself, so it still filters noise.

A 20-period WMA gives the newest candle 20 times the say of the oldestHow much each of the last 20 candles counts in the average. Age 0 is the newest candle.0%2%4%6%8%10%newest5 old10 old15 oldoldestSMA 20EMA 20WMA 20Newest candle: weight 20, 9.5% of the averageOldest candle: weight 1, 0.5%Illustration: weights computed from the formulas (WMA weights 20 down to 1, EMA smoothing 2/(N+1)).
The WMA's weights fall in a straight line, from 20 on the newest candle to 1 on the oldest.

The EMA solves the same problem with an exponential decay. The two behave similarly. The WMA’s weights fall to zero at the edge of the window, so very old bars drop out completely. The EMA never fully forgets. In practice the WMA is often a touch quicker to turn at trend changes, and a touch quicker to whipsaw in chop.

What Makes a WMA Crossover Fire?

The signal is simple. A fast WMA, such as a 10-period, crosses above a slow WMA, such as a 30-period. That is a long signal. The fast line crossing below the slow line is a short or exit signal.

Three things determine how good the signal is:

  • The gap between the periods. A 10/30 pair reacts quickly. A 20/100 pair catches only major trends. Wider gaps mean fewer trades and fewer false starts.
  • The slope of the slow line. A cross while the slow WMA is still falling is a counter-trend trade. A cross while the slow WMA has already flattened or turned up is a trend trade.
  • Where price sits. A bullish cross with price already far above both averages is late. The best crosses happen with price close to the lines.
WMA 10/30 on Bitcoin: 5 golden crosses and 4 death crosses in ten days1-hour candles, 6 Nov – 15 Nov 2026. Green dot: fast WMA crosses above slow (long signal).Red dot: crosses below (exit).$65k$70k$75k6 Nov8 Nov11 Nov13 Nov15 NovWMA 10 (fast)WMA 30 (slow)Data: BTC-USD 1-hour candles from Coinbase. Signals marked, not traded: this is not a backtest. Hover a candle or dot.
Green dot: fast WMA crosses above slow. Red dot: it crosses back below. Hover a dot for the date and price.

Which WMA Crossover Setups Deserve a Backtest?

Three variations are worth running side by side. Each adds one filter to the raw cross.

The Plain Two-Line Cross

Go long when the 10 WMA crosses above the 30 WMA. Exit when it crosses back below. No other rules. This is the baseline. Every other version must beat it after costs, or the extra rules are not earning their place.

Expect a low win rate, often 35% to 45%, and a handful of large winners. That is the shape of every trend-following system. Judge it on expectancy, not on how often it is right.

The Slope-Filtered Cross

Take the same cross, but only when the slow WMA is higher than it was five bars ago. This removes most counter-trend crosses inside a falling market. Trade count falls. Average winner usually rises. StockCharts covers why the direction of the slower average matters more than the cross itself.

The Price-Confirmed Cross

Take the cross, then wait for the next candle to close above the fast WMA. This costs one bar of entry. It filters the crosses where price immediately snaps back. It is the version most traders end up running, because it removes the ugliest losers.

How Should You Pair the Fast and Slow Periods?

There is no magic pair. There are sensible ranges.

TimeframeFast WMASlow WMACharacter
15-minute921Many trades, needs tight costs
1-hour1030Balanced for crypto majors
4-hour2050Swing trades, fewer whipsaws
Daily20100Major trends only

Test a grid around each pair rather than a single value. If 10/30 works but 9/30 and 11/30 fall apart, the result is noise. A robust pair has neighbours that also work.

Keep the ratio around 1:3 to 1:5. Below 1:2 the lines hug each other and cross constantly. Above 1:6 the slow line barely moves, and the cross becomes a slow-trend filter rather than a signal.

Where Does a WMA Crossover Get Chopped Up?

Sideways markets. There is no polite way to say it. When price oscillates inside a range, the fast WMA crosses the slow WMA repeatedly. Each cross is a small loss. Ten small losses in a row is normal in a two-week range.

Three mistakes make this worse:

  • Shortening the periods to catch moves earlier. Faster lines mean more crosses in chop. You trade the problem you were trying to avoid.
  • Removing the exit cross. Some traders enter on the cross and exit on a fixed target. That turns a trend system into something else. Test it as a separate strategy, not as a tweak.
  • Ignoring fees. A 10/30 WMA on a 15-minute chart might trade 200 times a year. At 0.1% per side, costs eat 40% of capital before any edge shows. Run the backtest with real fees from the start.
A sideways week: 9 WMA 10/30 crosses, price went nowhereBitcoin 1-hour closes, 23 Sept – 30 Sept 2026, the most range-bound seven days of the year(net move under 0.1%). Each dot is a cross.$83k$84k$85k23 Sept24 Sept25 Sept26 Sept27 Sept28 Sept29 SeptCloseWMA 10 (fast)WMA 30 (slow)Data: BTC-USD 1-hour candles from Coinbase. Week picked by net move vs distance travelled. Not a backtest.
Nine crosses in a week that went nowhere: each one is a small loss for a plain crossover.

A regime filter helps. Only take crosses when the ADX is above 20, or when the slow WMA has moved more than 1% in the last 20 bars. Both rules sit the strategy out in flat markets.

Wiring a WMA Crossover Strategy in Arrow Algo

The whole strategy is five blocks. No code is needed.

  1. Drag a Data Watcher onto the canvas. Choose the exchange, pair and timeframe, such as BTC/USDT on the 1-hour chart.
  2. Add two WMA indicator blocks. Set one to period 10 and the other to period 30. Connect the Data Watcher’s close price to both.
  3. Add a Crossover block. Connect the fast WMA to the first input and the slow WMA to the second. Its output fires once when the fast line crosses above the slow line.
  4. Connect that output to a Buy action block. Set the position size.
  5. Add a second Crossover block with the inputs reversed. Connect it to a Sell action block for the exit.
The baseline WMA crossover is five blocksData in, two averages, a cross in each direction, one action each. Filters slot in betweenthe Crossover and the Buy.Data WatcherBTC/USDT, 1-hourWMA 10fast average ofcloseWMA 30slow average ofcloseCrossoverfast above slowCrossoverinputs reversedBuyset positionsizeSellthe exitSlope or regime filter goes here
The baseline strategy: data, two averages, a cross each way, one action each.

For the slope filter, add a Lag block on the slow WMA set to five bars. Feed the current WMA and the lagged WMA into a Condition block set to “greater than”. Use a second Condition block with the AND operator to combine that with the crossover before it reaches the Buy block.

Backtest on at least two years of data. Then open the trade list and look at the losing streaks. If the longest streak is more than you could sit through live, widen the periods or add the regime filter and run it again.

What Should Survive Into Your Rules?

  • A WMA crossover strategy fires earlier than the SMA version because recent bars carry more weight.
  • Earlier also means more false signals in ranges. The slope and price-confirmation filters cut the worst of them.
  • Keep the fast-to-slow ratio between 1:3 and 1:5, and test the neighbours of any pair that works.
  • Costs decide whether a fast crossover is viable. Include real fees before judging the result.
  • In Arrow Algo the baseline is five blocks. Add filters one at a time and backtest each change on its own.

Disclaimer: This content is for educational purposes only and does not constitute financial advice. Trading involves significant risk and you should only trade with capital you can afford to lose. Past performance is not indicative of future results. Always conduct your own research before making any trading decisions.

Ready to build your own automated trading strategies without writing a single line of code? Start for free at Arrow Algo and join thousands of traders who've made the switch to systematic trading.

See Arrow Algo first on Google. Add us as a preferred source and our articles show up more in your Top Stories.

Add as a preferred source on Google