Skip to content

Book Strategies

Savvas Leousis edited this page Sep 26, 2026 · 1 revision

Book Strategies

Six strategies built from the trading-book research (backlog items BL-38 to BL-41). All are long-only. They read split- and dividend-adjusted bars (or point-in-time statements) and leave sizing to a portfolio constructor.

flowchart LR
  subgraph X[Cross-sectional: rank a universe]
    QM[quant_momentum]
    SOM[stocks_on_the_move]
    QV[quant_value]
  end
  subgraph T[Time-series: each ticker alone]
    EW[ewmac_trend]
    TS[tsmom]
    ATH[ath_trend]
  end
  X --> C1[equal weight or ATR parity]
  T --> C2[vol_target]
Loading

Cross-sectional (equities)

id Book Rule
quant_momentum Gray and Vogel, Quantitative Momentum 12-2 momentum, keep the top 10%, then the half with the smoothest path (frog in the pan). Equal weight. Rebalance on the last session of Feb, May, Aug, Nov.
stocks_on_the_move Clenow, Stocks on the Move Score = annualised 90-day regression slope times R². Top 20%, above the 100-day average, no 15% one-day gap. No new buys while the index is below its 200-day average. Size with atr_parity. Trade on Wednesdays.
quant_value Gray and Carlisle, Quantitative Value Cheapest EBIT/TEV after forensic screens (accruals, net operating assets, Beneish, Altman) and a quality rank. Piotroski and magic-formula modes too. Statements count only from their filing date.

Run them on daily bars with rebalance_every_bars = 1; they hold on days that are not their trading day.

Trend following (equity, crypto, commodity)

Each ticker gets a Carver forecast: signed, about 10 on average, capped at 20. Negative forecasts are flat for now. The vol_target constructor sizes the book to an annual volatility target tau (default 20%) with a 10% no-trade buffer.

id Book Rule
ewmac_trend Carver, Systematic Trading EMA crossovers at speeds 8, 16, 32 and 64, scaled and combined.
tsmom Moskowitz, Ooi and Pedersen; Clenow Sign (or scaled size) of the 125 and 250 day returns, refreshed monthly.
ath_trend Wilcox and Crittenden Buy a weekly close at an all-time high; exit when the close falls 10 ATR below the high since entry. Equity and crypto.

Trailing stop wrapper

TrailingStopWrapper puts a volatility-scaled trailing stop around any strategy: exit when the close falls below the high since entry minus 3 x ATR(20), sit out 5 bars, then re-enter if the inner strategy still wants in. It is stateless: the stop is rebuilt from the bars every call. It is used in code; it is not in the lab catalog.

Example

uv run stonks lab run quant_momentum --start 2015-01-01 --end 2025-01-01 \
  --tickers AAPL.US,MSFT.US,NVDA.US,AMZN.US,META.US --preset standard

Full formulas, parameters and deviations from the books: docs/strategies/book-strategies.md in the repo. See also Strategies.

Clone this wiki locally