# The study behind docs/research/README.md. Rebuild the report with `make research`
# (that is, `trading study docs/research/study.yaml`). The first run downloads the bars
# into data/cache, with checksums; later runs read them from there, offline.

title: Walk-forward study of the built-in strategies

base:
  simulation:
    # Liquid ETFs across US large, tech and small caps, developed and emerging markets,
    # long Treasuries, gold and real estate.
    symbols: [SPY, QQQ, IWM, EFA, EEM, TLT, GLD, VNQ]
    data_source: yfinance
    start: "2010-01-01"
    end: "2025-01-01"
    interval: 1d
    cache_dir: data/cache
  order_manager:
    sizing: percent
    percent_equity: 12.5         # an eighth of equity a position: fully invested in all eight
  execution:
    commission_per_share: 0.005
    commission_min: 1.0
    slippage_bps: 1.0
    spread_bps: 2.0
    impact: 1.0
  risk:
    max_position: null
    max_position_pct: null
    max_gross_leverage: 1.05
    max_drawdown_pct: null
  portfolio:
    starting_cash: 100000.0
    margin_multiplier: 1.0       # a cash account
    borrow_rate_pct: 0.5
  metrics:
    bootstrap: 2000
  persistence:
    enabled: false

walk_forward:
  train_bars: 756                # three years
  test_bars: 252                 # the year after
  metric: sharpe_ratio

strategies:
  buy_and_hold: {}               # the benchmark, paying the same costs

  random: {}                     # a null strategy: what trading costs without an edge

  ma_crossover:
    grid:
      strategy.fast_period: [10, 20, 50]
      strategy.slow_period: [100, 200]

  rsi:
    grid:
      strategy.period: [2, 14]
      strategy.oversold: [10, 30]
      strategy.overbought: [70, 90]

  momentum_rotation:
    overrides:
      strategy.top_k: 3
      order_manager.percent_equity: 33.0
    grid:
      strategy.lookback: [63, 126, 252]
      strategy.rebalance_every: [21, 63]

  pairs:
    overrides:
      simulation.symbols: [EWA, EWC]   # Australia and Canada: two commodity economies
      order_manager.allow_short: true
      order_manager.percent_equity: 50.0
      portfolio.margin_multiplier: 2.0
      risk.max_gross_leverage: 1.05
    grid:
      strategy.lookback: [60, 120]
      strategy.entry_z: [1.5, 2.0]
