A/D Line 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

Accumulation/Distribution Line tracks cumulative money flow. When the A/D line rises above its moving average, it signals institutional accumulation. Enters long on that cross, exits when A/D drops below its MA.

Implementation

class ADLineTrend(Strategy):
    n = 20

    def init(self):
        ad = _ad_line(self.data.High, self.data.Low, self.data.Close, self.data.Volume)
        self.ad = self.I(lambda: ad, name="AD")
        self.ad_ma = self.I(_sma, ad, self.n)

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

Performance metrics

Total return+111.094%
Net profit$1,110,936
Gross profit$1,186,115
Gross loss$894,215
CAGR+6.421%
Annualized return+6.421%
Monthly average return+0.529%
Median monthly return+0.013%
Best month return+5.800%
Worst month return-7.180%
Rolling 1-month return+11.334%
Return per trade+0.246
Log return CAGR+13.431%
Compounded vs simple return difference-110.376%

Equity curves

Chart for symbol:

Charts & distributions

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

Equity curve vs ^GSPC — buy/sell signals

Strategy equityIndex (normalized)▲ Buy▼ Sell

55 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+23.902%
Net profit$239,020
Gross profit$971,170
Gross loss$703,000
CAGR+6.657%
Annualized return+6.657%
Monthly average return+0.591%
Median monthly return+0.202%
Best month return+5.251%
Worst month return-4.206%
Rolling 1-month return+7.025%
Return per trade+0.391
Log return CAGR-37.506%
Compounded vs simple return difference-40.920%