Price 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

Price Oscillator is the percentage difference between a fast and slow EMA. Enters long when the oscillator crosses above zero (fast EMA overtaking slow), exits on the reverse. A percentage-normalised version of MACD.

Implementation

class PriceOscillator(Strategy):
    fast = 12
    slow = 26

    def init(self):
        self.po = self.I(_price_oscillator, self.data.Close, self.fast, self.slow)

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

Performance metrics

Total return+1.829%
Net profit$18,285
Gross profit$358,206
Gross loss$326,923
CAGR-0.299%
Annualized return-0.299%
Monthly average return+0.034%
Median monthly return-0.397%
Best month return+5.013%
Worst month return-8.418%
Rolling 1-month return+10.035%
Return per trade+0.192
Log return CAGR-8.929%
Compounded vs simple return difference-5.938%

Equity curves

Chart for symbol:

Charts & distributions

2024-04 → 2026-04 · 5-year daily data

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

12 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+3.019%
Net profit$30,190
Gross profit$261,750
Gross loss$217,230
CAGR+0.898%
Annualized return+0.898%
Monthly average return+0.084%
Median monthly return-3.619%
Best month return+5.196%
Worst month return-8.959%
Rolling 1-month return+5.742%
Return per trade+0.248
Log return CAGR-30.755%
Compounded vs simple return difference-16.590%