Fractal Breakout

← 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

Fractal Breakout uses Bill Williams' fractal pattern — a bar with two lower highs on each side. Enters long when price closes above a confirmed fractal high, exits when price falls to a fractal low.

Implementation

class FractalBreakout(Strategy):
    left = 2; right = 2

    def init(self):
        n = self.left + self.right + 1
        h, l = pd.Series(self.data.High), pd.Series(self.data.Low)
        fh = h.rolling(n, center=True).apply(lambda x: x.iloc[self.left] if x.iloc[self.left]==x.max() else np.nan, raw=False)
        fl = l.rolling(n, center=True).apply(lambda x: x.iloc[self.left] if x.iloc[self.left]==x.min() else np.nan, raw=False)
        self.fh = self.I(lambda: fh, name="FractalHigh")
        self.fl = self.I(lambda: fl, name="FractalLow")

    def next(self):
        idx = self.left + self.right + 2
        fh_val = self.fh[-idx]; fl_val = self.fl[-idx]
        if not np.isnan(fh_val) and self.data.Close[-1] >= fh_val and not self.position: self.buy()
        elif not np.isnan(fl_val) and self.data.Close[-1] <= fl_val and self.position: self.position.close()

Performance metrics

Total return+17.416%
Net profit$174,158
Gross profit$532,524
Gross loss$376,862
CAGR+2.166%
Annualized return+2.166%
Monthly average return+0.228%
Median monthly return+0.737%
Best month return+6.843%
Worst month return-8.859%
Rolling 1-month return+13.290%
Return per trade+0.471
Log return CAGR+19.563%
Compounded vs simple return difference-16.380%

Equity curves

Chart for symbol:

Charts & distributions

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

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

16 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-8.445%
Net profit-$84,450
Gross profit$324,940
Gross loss$392,130
CAGR-2.618%
Annualized return-2.618%
Monthly average return-0.146%
Median monthly return-3.421%
Best month return+0.802%
Worst month return-9.183%
Rolling 1-month return+10.022%
Return per trade-0.552
Log return CAGR-27.435%
Compounded vs simple return difference-3.504%