Quant Methods Overview

The prebuilt strategy library. TSMomentum, BollingerMeanRev, MovingAverageCross, RSIMeanRev, Ensemble

Horizon ships a tested library of classical quant strategies. Each is a real Strategy subclass with real feature computation, real signal emission, and real backtest coverage. Drop them straight into hz.run(strategies=[...]) or subclass them to extend.

At a glance

Quick comparison

StrategySignal typeRegime fitTurnoverDrawdown profile
TSMomentumTrendTrendingMediumSlow pullbacks
BollingerMeanRevMean reversionRange / chopHighFrequent small losses
MovingAverageCrossTrendTrendingLowWhipsaws in chop
RSIMeanRevMean reversionRangeMedium-highExtreme hits costly
Ensemble(all)MixedAll regimesCombinedDiversified

Importing them

python
from horizon.quant import (
    TSMomentum,
    BollingerMeanRev,
    MovingAverageCrossStrategy,
    RSIMeanRev,
    Ensemble,
)

Using them in a backtest

python
import horizon as hz
from horizon.asset_classes import AssetClass, Equity
from horizon.data import SyntheticGBM
from horizon.discovery import StaticUniverse
from horizon.discovery.base import Market
from horizon.portfolio import KellyOptimizer
from horizon.quant import BollingerMeanRev, TSMomentum
from horizon.risk import RiskProfile

result = hz.run(
    mode="backtest",
    strategies=[
        TSMomentum(lookback=20, edge_bps=60),
        BollingerMeanRev(window=20, entry_z=2.0, edge_bps=50),
    ],
    asset_classes=[Equity],
    universe=StaticUniverse([
        Market(id=t, asset_class=AssetClass.Equity)
        for t in ["AAPL", "MSFT", "NVDA"]
    ]),
    portfolio=KellyOptimizer(kelly_fraction=0.20),
    risk=RiskProfile.moderate(),
    data_source=SyntheticGBM(["AAPL", "MSFT", "NVDA"], n_bars=252, seed=42),
    backtest=hz.BacktestConfig(initial_cash_usd=100_000),
)

Multiple strategies deposit signals into the same SignalStore; the portfolio optimizer sees the combined list and allocates capital across all of them.

Picking the right one

Subclassing

Every prebuilt is a normal Python class. You can subclass any of them to customize:

python
from horizon.quant import TSMomentum
from horizon.types import Signal

class MyMomentum(TSMomentum):
    """TSMomentum with a volatility filter."""

    def evaluate(self, f, universe):
        # Only trade when realized vol is elevated
        return [
            sig for sig in super().evaluate(f, universe)
            if f.vol[sig.market_id] > 0.15
        ]

All prebuilts use the real feature library

See Features for what each input computes.

Verified behavior

Every prebuilt is covered by tests/test_backtest_integration.py::TestQuantLibrary:

python
@pytest.mark.parametrize("strat_fn", [
    lambda: TSMomentum(lookback=10),
    lambda: BollingerMeanRev(window=15, entry_z=1.5),
    lambda: MovingAverageCrossStrategy(fast=5, slow=20),
    lambda: RSIMeanRev(window=10),
])
def test_each_strategy_runs(self, strat_fn) -> None:
    result = hz.run(
        mode="backtest",
        strategies=[strat_fn()],
        ...,
    )
    assert result is not None
    assert len(result.equity_curve) == 100
    assert result.equity_curve[0][1] == 100_000.0

Every strategy runs end-to-end on synthetic data without errors. The full 163-test suite includes these as integration tests.

Next