Disparity Index

← 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

Disparity Index measures the percentage difference between price and its N-period SMA. Enters long when the index crosses above zero (price reclaiming its average), exits when it drops back below zero.

Implementation

class DisparityIndex(Strategy):
    n = 14

    def init(self):
        self.disp = self.I(_disparity, self.data.Close, self.n)

    def next(self):
        if self.disp[-1] > 0 and self.disp[-2] <= 0 and not self.position:
            self.buy()
        elif self.disp[-1] < 0 and self.position:
            self.position.close()

Performance metrics

Total return+14.424%
Net profit$144,237
Gross profit$839,871
Gross loss$704,123
CAGR+1.368%
Annualized return+1.368%
Monthly average return+0.165%
Median monthly return-1.706%
Best month return+6.401%
Worst month return-9.880%
Rolling 1-month return+11.929%
Return per trade+0.134
Log return CAGR-9.233%
Compounded vs simple return difference-20.437%

Equity curves

Chart for symbol:

Charts & distributions

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

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

52 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.299%
Net profit$302,990
Gross profit$761,090
Gross loss$460,270
CAGR+8.284%
Annualized return+8.284%
Monthly average return+0.690%
Median monthly return-2.989%
Best month return+2.539%
Worst month return-13.686%
Rolling 1-month return+4.458%
Return per trade+0.512
Log return CAGR-31.407%
Compounded vs simple return difference-44.193%