EMA Ribbon

← 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

EMA Ribbon uses multiple EMAs (5, 10, 20, 50). Enters long only when price is above all four EMAs simultaneously — a strong trend confirmation. Exits as soon as price drops below any single EMA.

Implementation

class EMARibbon(Strategy):
    periods = (5, 10, 20, 50)

    def init(self):
        self.emas = [self.I(_ema, self.data.Close, p) for p in self.periods]

    def next(self):
        c = self.data.Close[-1]
        if all(c > ema[-1] for ema in self.emas) and not self.position:
            self.buy()
        elif any(c < ema[-1] for ema in self.emas) and self.position:
            self.position.close()

Performance metrics

Total return-3.400%
Net profit-$34,004
Gross profit$2,957
Gross loss$52,270
CAGR-0.883%
Annualized return-0.883%
Monthly average return-0.069%
Median monthly return-0.561%
Best month return+0.156%
Worst month return-2.354%
Rolling 1-month return+1.225%
Return per trade-0.700
Log return CAGR-6.195%
Compounded vs simple return difference+0.490%

Equity curves

Chart for symbol:

Charts & distributions

2022-12 → 2026-04 · 5-year daily data

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

1 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+0.061%
Net profit$610
Gross profit$610
Gross loss$0
CAGR+0.018%
Annualized return+0.018%
Monthly average return+0.001%
Median monthly return+0.000%
Best month return+0.000%
Worst month return+0.000%
Rolling 1-month return+0.161%
Return per trade+0.061
Log return CAGR+0.153%
Compounded vs simple return difference-0.000%