Elder Ray

← 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

Elder Ray splits price action into Bull Power (High minus EMA) and Bear Power (Low minus EMA). Enters long when Bull Power is positive and rising, exits when Bear Power turns positive.

Implementation

class ElderRay(Strategy):
    n = 13

    def init(self):
        ema = _ema(pd.Series(self.data.Close), self.n)
        self.bull = self.I(lambda: pd.Series(self.data.High) - ema, name="Bull")
        self.bear = self.I(lambda: pd.Series(self.data.Low) - ema, name="Bear")

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

Performance metrics

Total return-9.398%
Net profit-$93,982
Gross profit$1,016,858
Gross loss$1,156,956
CAGR-4.413%
Annualized return-4.413%
Monthly average return-0.302%
Median monthly return-3.015%
Best month return+3.297%
Worst month return-12.617%
Rolling 1-month return+5.214%
Return per trade-0.107
Log return CAGR-34.040%
Compounded vs simple return difference-7.925%

Equity curves