ROC 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

Compares a fast and slow Rate of Change. Enters long when the fast ROC crosses above the slow ROC (short-term momentum accelerating relative to longer-term), exits on the reverse crossover.

Implementation

class ROCCrossover(Strategy):
    n_fast = 5
    n_slow = 20

    def init(self):
        self.roc_fast = self.I(_roc, self.data.Close, self.n_fast)
        self.roc_slow = self.I(_roc, self.data.Close, self.n_slow)

    def next(self):
        if crossover(self.roc_fast, self.roc_slow) and not self.position:
            self.buy()
        elif crossover(self.roc_slow, self.roc_fast) and self.position:
            self.position.close()

Performance metrics

Total return-1.034%
Net profit-$10,341
Gross profit$550,744
Gross loss$549,503
CAGR-0.076%
Annualized return-0.076%
Monthly average return+0.033%
Median monthly return-2.705%
Best month return+5.011%
Worst month return-10.194%
Rolling 1-month return+10.259%
Return per trade+0.003
Log return CAGR-20.990%
Compounded vs simple return difference-8.866%

Equity curves

Chart for symbol:

Charts & distributions

2023-09 → 2026-04 · 5-year daily data

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

35 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+15.071%
Net profit$150,710
Gross profit$516,670
Gross loss$342,740
CAGR+4.312%
Annualized return+4.312%
Monthly average return+0.377%
Median monthly return-0.746%
Best month return+18.851%
Worst month return-6.698%
Rolling 1-month return+23.642%
Return per trade+0.403
Log return CAGR+20.232%
Compounded vs simple return difference-7.485%