Ultimate Oscillator

← 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

Combines three timeframes (7, 14, 28 periods) of buying pressure vs true range into one oscillator. Enters long when below 30 (oversold across all timeframes), exits above 70. Multi-timeframe design reduces false signals.

Implementation

class UltimateOscillator(Strategy):
    n1 = 7
    n2 = 14
    n3 = 28

    def init(self):
        self.uo = self.I(_ultimate_oscillator, self.data.High, self.data.Low, self.data.Close, self.n1, self.n2, self.n3)

    def next(self):
        if self.uo[-1] < 30 and not self.position:
            self.buy()
        elif self.uo[-1] > 70 and self.position:
            self.position.close()

Performance metrics

Total return+80.330%
Net profit$803,304
Gross profit$1,331,468
Gross loss$770,452
CAGR+13.113%
Annualized return+13.113%
Monthly average return+1.089%
Median monthly return+0.156%
Best month return+7.836%
Worst month return-7.666%
Rolling 1-month return+11.298%
Return per trade+2.038
Log return CAGR+2.622%
Compounded vs simple return difference-80.490%

Equity curves

Chart for symbol:

Charts & distributions

2025-05 → 2026-04 · 5-year daily data

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

24 trades · green dashes = buy entries · red dashes = sell exits

Drawdown (underwater)

Rolling 1-month Sharpe

Rolling 1-month return (%)

Period return (≈ monthly)

Return distribution (bar returns)

MAE vs MFE (trades)

Rolling 12m Beta

Rolling 12m correlation

Monthly returns (run)

Performance Matrix

Total return+52.530%
Net profit$525,300
Gross profit$1,194,580
Gross loss$684,980
CAGR+13.537%
Annualized return+13.537%
Monthly average return+1.088%
Median monthly return+1.882%
Best month return+5.781%
Worst month return-11.653%
Rolling 1-month return+6.140%
Return per trade+1.781
Log return CAGR-22.470%
Compounded vs simple return difference-62.136%