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.00%
Net profit$0
CAGR+0.00%
Annualized return+0.00%
Monthly average return+0.00%
Median monthly return+0.00%
Best month return+0.00%
Worst month return+0.00%
Rolling 1-month return+0.00%
Log return CAGR+0.00%
Compounded vs simple return difference+0.00%

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.00%
Net profit$0
CAGR+0.00%
Annualized return+0.00%
Monthly average return+0.00%
Median monthly return+0.00%
Best month return+0.00%
Worst month return+0.00%
Rolling 1-month return+0.00%
Log return CAGR+0.00%
Compounded vs simple return difference+0.00%

Risk & trade diagnostics

Drawdown and rolling Sharpe for one symbol at a time appear in the equity charts above. This section adds strategy-specific views: how each index run for mass-index sits in risk–return space, engine stop / take-profit settings when present, and per-trade MAE/MFE when OHLC trade stats exist in the JSON. Older static portfolio PNGs aggregated every strategy; these plots are scoped to this strategy only.

Stop loss / take-profit (this run)

These rules were applied when opening positions: fixed stop and take-profit prices from entry (backtesting.py sl / tp), plus an optional maximum hold in bars. They change realized outcomes versus signal-only exits; curves and metrics on this page already reflect them.

Stop loss
5%
Take profit
10%
Max hold

SL/TP combinations (this strategy)

These are strategy-specific SL/TP combinations from the sensitivity sweep. The best Sharpe combination is highlighted.

Best Sharpe combo: SL 0% / TP 0% (0.00)

SLTPSharpeReturnMax DDWin %
0%0%0.000.00%0.00%0.00%
0%5%0.000.00%0.00%0.00%
0%10%0.000.00%0.00%0.00%
0%15%0.000.00%0.00%0.00%
3%0%0.000.00%0.00%0.00%
3%5%0.000.00%0.00%0.00%
3%10%0.000.00%0.00%0.00%
3%15%0.000.00%0.00%0.00%
5%0%0.000.00%0.00%0.00%
5%5%0.000.00%0.00%0.00%
5%10%0.000.00%0.00%0.00%
5%15%0.000.00%0.00%0.00%
7%0%0.000.00%0.00%0.00%
7%5%0.000.00%0.00%0.00%
7%10%0.000.00%0.00%0.00%
7%15%0.000.00%0.00%0.00%

Performance with these rules (symbol by symbol)

Each row is one run for mass-index. Values already include the stop / target / max-hold settings shown in the row.

SymbolStop lossTake profitMax holdTotal returnSharpeMax DD
^AXJO (S&P/ASX 200)5%10%0.00%0.00%
^BSESN (BSE Sensex)5%10%0.00%0.00%
^BVSP (Bovespa)5%10%0.00%0.00%
^DJI (Dow Jones Industrial Average)5%10%0.00%0.00%
^FCHI (CAC 40)5%10%0.00%0.00%
^FTSE (FTSE 100)5%10%0.00%0.00%
^GDAXI (DAX)5%10%0.00%0.00%
^GSPC (S&P 500)5%10%0.00%0.00%
^GSPTSE (TSX Composite)5%10%0.00%0.00%
^HSI (Hang Seng)5%10%0.00%0.00%
^IXIC (NASDAQ Composite)5%10%0.00%0.00%
^KS11 (KOSPI)5%10%0.00%0.00%
^MERV (Merval)5%10%0.00%0.00%
^N100 (Euronext 100)5%10%0.00%0.00%
^N225 (Nikkei 225)5%10%0.00%0.00%
^NSEI (Nifty 50)5%10%0.00%0.00%
^RUT (Russell 2000)5%10%0.00%0.00%
^SSMI (Swiss Market)5%10%0.00%0.00%
^STOXX50E (Euro Stoxx 50)5%10%0.00%0.00%
^TWII (Taiwan Weighted)5%10%0.00%0.00%

Parameter optimization

Parameter optimization

Mass Index on ^GSPC. Objective: Sharpe Ratio. 6 runs. Color =

Results by region

Index Performance Statistics

Performance metrics for each index symbol tested with this strategy.

IndexCountryReturn %SharpeSortinoMax DD %Win Rate %TradesProfit FactorVolatility %
MervalArgentina+0.00%--+0.00%-0-+0.00%
S&P/ASX 200Australia+0.00%--+0.00%-0-+0.00%
BovespaBrazil+0.00%--+0.00%-0-+0.00%
TSX CompositeCanada+0.00%--+0.00%-0-+0.00%
Euro Stoxx 50Europe+0.00%--+0.00%-0-+0.00%
Euronext 100Europe+0.00%--+0.00%-0-+0.00%
CAC 40France+0.00%--+0.00%-0-+0.00%
DAXGermany+0.00%--+0.00%-0-+0.00%
Hang SengHong Kong+0.00%--+0.00%-0-+0.00%
BSE SensexIndia+0.00%--+0.00%-0-+0.00%
Nifty 50India+0.00%--+0.00%-0-+0.00%
Nikkei 225Japan+0.00%--+0.00%-0-+0.00%
KOSPISouth Korea+0.00%--+0.00%-0-+0.00%
Swiss MarketSwitzerland+0.00%--+0.00%-0-+0.00%
Taiwan WeightedTaiwan+0.00%--+0.00%-0-+0.00%
FTSE 100UK+0.00%--+0.00%-0-+0.00%
Dow Jones Industrial AverageUS+0.00%--+0.00%-0-+0.00%
NASDAQ CompositeUS+0.00%--+0.00%-0-+0.00%
Russell 2000US+0.00%--+0.00%-0-+0.00%
S&P 500US+0.00%--+0.00%-0-+0.00%