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.
Chande Momentum Oscillator measures the sum of recent gains minus losses divided by their total. Enters long when CMO crosses above zero (net positive momentum), exits on the reverse crossover.
class ChandeMomentum(Strategy):
n = 14
def init(self):
self.cmo = self.I(_chande_momentum, self.data.Close, self.n)
def next(self):
if self.cmo[-1] > 0 and self.cmo[-2] <= 0 and not self.position:
self.buy()
elif self.cmo[-1] < 0 and self.cmo[-2] >= 0 and self.position:
self.position.close()