WMA Crossover

← strategies

Strategy

Methodology

This strategy is backtested on daily OHLCV price data across major US equity indices and ETFs. Entry and exit signals are generated from the strategy's indicators with no lookahead bias — trades execute at the open of the bar following the signal.

Performance metrics are computed per symbol and shown individually. The parameter optimization section (where available) runs a grid search over the strategy's key parameters, optimizing for Sharpe ratio. Transaction costs and slippage are not modeled.

The signal logic and indicator code for this strategy is shown in the methodology code section below.

Methodology

Weighted Moving Average crossover, where recent prices carry more weight than older ones. Enters long on fast WMA crossing above slow WMA, exits on the reverse. More responsive than SMA crossover.

Implementation

class WMACross(Strategy):
    n_fast = 10
    n_slow = 20

    def init(self):
        self.wma_fast = self.I(_wma_simple, self.data.Close, self.n_fast)
        self.wma_slow = self.I(_wma_simple, self.data.Close, self.n_slow)

    def next(self):
        if crossover(self.wma_fast, self.wma_slow):
            self.buy()
        elif crossover(self.wma_slow, self.wma_fast):
            self.position.close()

Performance metrics

Total return+14.322%
Net profit$143,216
Gross profit$580,143
Gross loss$425,836
CAGR+2.570%
Annualized return+2.570%
Monthly average return+0.252%
Median monthly return+0.335%
Best month return+10.934%
Worst month return-7.699%
Rolling 1-month return+16.338%
Return per trade+0.470
Log return CAGR+26.600%
Compounded vs simple return difference-9.921%

Equity curves

Chart for symbol:

Charts & distributions

2024-10 → 2026-04 · 5-year daily data

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

20 trades · green dashes = buy entries · red dashes = sell exits

Drawdown (underwater)

Rolling 1-month Sharpe

Rolling 1-month return (%)

Period return (≈ monthly)

Return distribution (bar returns)

MAE vs MFE (trades)

Rolling 12m Beta

Rolling 12m correlation

Monthly returns (run)

Performance Matrix

Total return+30.396%
Net profit$303,960
Gross profit$592,340
Gross loss$297,980
CAGR+8.308%
Annualized return+8.308%
Monthly average return+0.664%
Median monthly return+4.407%
Best month return+13.917%
Worst month return-13.226%
Rolling 1-month return+17.296%
Return per trade+1.340
Log return CAGR+34.904%
Compounded vs simple return difference-17.781%