Mass 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

Mass Index identifies trend reversals by measuring the range between high and low prices. A 'reversal bulge' occurs when the 25-period sum rises above 27 then drops below 26.5, signalling a potential direction change.

Implementation

class MassIndex(Strategy):
    n = 9
    n2 = 25
    thresh_high = 27
    thresh_low = 26.5

    def init(self):
        self.mi = self.I(_mass_index, self.data.High, self.data.Low, self.n, self.n2)

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

Performance metrics

Total return+0.000%
Net profit$0
CAGR+0.000%
Annualized return+0.000%
Monthly average return+0.000%
Median monthly return+0.000%
Best month return+0.000%
Worst month return+0.000%
Rolling 1-month return+0.000%
Log return CAGR+0.000%
Compounded vs simple return difference+0.000%

Equity curves

Chart for symbol:

Charts & distributions

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

Equity curve (^GSPC)

Strategy equityIndex (normalized)

Buy/sell markers unavailable for this run (trade signal timestamps are not present in the current dataset).

Drawdown (underwater)

Rolling 1-month Sharpe

Rolling 1-month return (%)

Period return (≈ monthly)

Return distribution (bar returns)

0

Rolling 12m Beta

Rolling 12m correlation

Monthly returns (run)

Performance Matrix

Total return+0.000%
Net profit$0
CAGR+0.000%
Annualized return+0.000%
Monthly average return+0.000%
Median monthly return+0.000%
Best month return+0.000%
Worst month return+0.000%
Rolling 1-month return+0.000%
Log return CAGR+0.000%
Compounded vs simple return difference+0.000%