Strategy
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.
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.
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()| 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% |
Buy/sell markers unavailable for this run (trade signal timestamps are not present in the current dataset).
| 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% |