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

QStick smooths the difference between close and open prices over N periods. Positive QStick means closes are consistently above opens (bullish candles). Enters long on cross above zero, exits on cross below.

Implementation

class QStick(Strategy):
    n = 14

    def init(self):
        q = pd.Series(self.data.Close) - pd.Series(self.data.Open)
        self.qstick = self.I(_sma, q, self.n)

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

Performance metrics

Total return+5.578%
Net profit$55,779
Gross profit$646,355
Gross loss$595,050
CAGR+0.251%
Annualized return+0.251%
Monthly average return+0.068%
Median monthly return-0.345%
Best month return+8.648%
Worst month return-11.418%
Rolling 1-month return+13.458%
Return per trade+0.046
Log return CAGR-2.166%
Compounded vs simple return difference-9.281%

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

42 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+15.034%
Net profit$150,340
Gross profit$594,400
Gross loss$427,990
CAGR+4.302%
Annualized return+4.302%
Monthly average return+0.385%
Median monthly return+1.855%
Best month return+12.232%
Worst month return-5.436%
Rolling 1-month return+18.044%
Return per trade+0.336
Log return CAGR+25.191%
Compounded vs simple return difference-5.709%