ADX Trend

← 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

Enters long when ADX is above 25 (strong trend) and +DI is above -DI (bullish direction). Exits when -DI crosses above +DI. Filters out choppy, low-conviction markets using the ADX threshold.

Implementation

class ADXTrend(Strategy):
    n = 14
    adx_thresh = 25

    def init(self):
        h, l, c = self.data.High, self.data.Low, self.data.Close
        self.adx = self.I(_adx, h, l, c, self.n)
        self.plus_di = self.I(_plus_di, h, l, c, self.n)
        self.minus_di = self.I(_minus_di, h, l, c, self.n)

    def next(self):
        if self.adx[-1] > self.adx_thresh and self.plus_di[-1] > self.minus_di[-1] and not self.position:
            self.buy()
        elif self.plus_di[-1] < self.minus_di[-1] and self.position:
            self.position.close()

Performance metrics

Total return+34.703%
Net profit$347,031
Gross profit$640,906
Gross loss$505,917
CAGR+1.876%
Annualized return+1.876%
Monthly average return+0.178%
Median monthly return-1.509%
Best month return+6.873%
Worst month return-10.063%
Rolling 1-month return+14.063%
Return per trade+0.046
Log return CAGR+1.618%
Compounded vs simple return difference-38.197%

Equity curves

Chart for symbol:

Charts & distributions

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

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

27 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-4.167%
Net profit-$41,670
Gross profit$240,730
Gross loss$274,060
CAGR-1.272%
Annualized return-1.272%
Monthly average return-0.064%
Median monthly return-1.018%
Best month return+4.018%
Worst month return-8.185%
Rolling 1-month return+8.056%
Return per trade-0.158
Log return CAGR-12.064%
Compounded vs simple return difference-0.807%