← Back to Docs

STRATEGY TEMPLATES

The SDK ships 8 reference templates under packages/strategy-sdk/templates/. Each is a complete, runnable Strategy subclass with an academic rationale. Clone one when creating a new strategy and customize the universe, lookbacks, and weighting.

Long-Only

TemplateBookLogic
momentum_ranking

Jegadeesh & Titman (1993) — momentum anomaly.

Long-onlyRank the universe by 6-month (126d) trailing return; hold the top names, equal weight.
mean_reversion

DeBondt & Thaler (1985); Lehmann (1990) — short-horizon reversal.

Long-onlyRank by 3-month (63d) return; buy the laggards expecting reversion.
sector_rotation

Moskowitz & Grinblatt (1999) — sector momentum.

Long-onlyGroup by sector, rank sectors by average 3-month return, tilt toward leaders.
value_quality

Fama-French (1992) value + Novy-Marx (2013) quality.

Long-onlyComposite of low price-to-fundamentals and high profitability / low leverage.

Long-Short

TemplateBookLogic
long_short_momentum

Jegadeesh & Titman (1993) — momentum on both tails.

Long-short (130/30)Long winners, short losers by 6-month return; ~100% net exposure.
long_short_mean_rev

Lehmann (1990) reversal vs. momentum continuation.

Long-short (130/30)Long short-term losers, short overextended winners.
long_short_pairs

Gatev, Goetzmann & Rouwenhorst (2006) — relative value.

Long-shortBet on convergence of diverging correlated names (return-rank proxy).
long_short_sector_neutral

Standard quant construction (AQR, Two Sigma).

Long-short (sector-neutral)Long/short within each sector to isolate stock-selection alpha.

How to Use a Template

  1. Create a new strategy and choose "Browse Templates".
  2. Pick a template — its code loads into the editor.
  3. Adjust parameters, then run a backtest.

See the First Backtest tutorial and Long-Short Strategies.