~/WORKSPACE/STRATEGIES/TEMPLATES
-
MD
README.MD
-
PY
FACTOR_COMBO_QUALITY_VALUE.PY
-
PY
MEAN_REVERSION_SHORT_TERM.PY
-
MD
MOMENTUM_VOL_TARGET.MD
-
PY
MOMENTUM_VOL_TARGET.PY
-
PY
MOMENTUM_WITH_REGIME_FILTER.PY
-
PY
PAIRS_TRADE_COINTEGRATION.PY
-
PY
VOLATILITY_TARGET_BALANCED.PY
README.MD
- # Strategy templates
- Five starter strategies covering the most common quantitative
- patterns. Each is realistic enough to defend in a quant
- interview, documented inline, parameterized with sensible
- defaults, and robust to small parameter changes.
- Drop-in usage:
- 1. Copy the file from strategies/templates/ to strategies/
- 2. Edit the universe list + parameters to your conviction
- 3. Backtest via the CLI or the IDE
FACTOR_COMBO_QUALITY_VALUE.PY
Excerpt not shown. Ships in the workspace.
MEAN_REVERSION_SHORT_TERM.PY
Excerpt not shown. Ships in the workspace.
MOMENTUM_VOL_TARGET.MD
- # Volatility-Targeted Cross-Sectional Momentum
- The one bundled strategy. What the large systematic managers
- actually deploy in size.
- Each day, rank 10 liquid ETFs by trailing 12-month return,
- skipping the most recent month. Pick the top half. Drop any
- whose 200-day SMA is falling. Equal-weight the survivors.
- Scale exposure so trailing realized vol targets 10%. Hold a
- day, repeat.
MOMENTUM_VOL_TARGET.PY
- from __future__ import annotations
- import numpy as np
- import pandas as pd
- from auracle.backtest import Strategy
- # ─── Tunable parameters ──────────────────────────────────────
- # Defaults are the canonical Asness/Moskowitz/Pedersen values.
- # Any value within ±30% of these gives the same qualitative
- # answer; that's the published-literature definition of
- # "robust, not curve-fit."
- LOOKBACK_DAYS = 252 # 12 months of daily bars
- MOMENTUM_SKIP_DAYS = 21 # skip 1 month — avoids reversal anomaly
- TREND_FILTER_DAYS = 200 # 200d SMA — the regime threshold
- TREND_SLOPE_DAYS = 20 # SMA must be ABOVE its 20d-ago value
- TOP_N = 5 # top half of the 10-ETF universe
- TARGET_VOL = 0.10 # 10% annualized portfolio vol
- VOL_LOOKBACK_DAYS = 60 # 3 months realized vol
- MAX_LEVERAGE = 2.0 # cap vol-target leverage at 2x
- MAX_POSITION_PCT = 0.25 # cap any single name at 25% NLV
- class MomentumVolTarget(Strategy):
MOMENTUM_WITH_REGIME_FILTER.PY
Excerpt not shown. Ships in the workspace.
PAIRS_TRADE_COINTEGRATION.PY
Excerpt not shown. Ships in the workspace.
VOLATILITY_TARGET_BALANCED.PY
Excerpt not shown. Ships in the workspace.
TERMINAL
~/workspace >
auracle event-backtest
strategies.templates.momentum_vol_target.MomentumVolTarget
~/workspace > try: ls, cat README.md, auracle
deploy ps