Skip to main content

Equity Trading

Horizon supports equities as a first-class asset class. The same engine, risk pipeline, feed system, and persistence layer work for stocks — the only differences are Side.Long instead of Side.Yes/Side.No, and price ranges that aren’t limited to 0-1.

Quick Start

What’s Different from Prediction Markets

Everything else is the same: pipeline composition, risk checks, order management, position tracking, persistence, monitoring, backtesting.

Side.Long

Equities don’t have Yes/No outcomes. The Side.Long variant represents a directional position:
The position tracker, risk pipeline, and P&L calculations all handle Side.Long the same way they handle Side.Yes — buy increases position, sell decreases it.

Risk Configuration

Risk.equity() provides defaults appropriate for stock trading:
The key difference from Risk() is price_max. Prediction market prices are bounded 0-1; stock prices aren’t. The Rust risk pipeline uses price_min/price_max from the config, so the same validation code works for both.

Market Discovery

Find stocks via Alpaca or IBKR:

CLI Discovery

Market Object

Equity markets use optional fields for asset class metadata:
All fields are optional and default to None. Prediction markets ignore them.

Feeds

Alpaca provides real-time equity data via WebSocket:
Multi-symbol feeds create per-symbol snapshots keyed as {feed_name}:{SYMBOL}:

CLI Tools

The equity CLI group provides market data tools:
These use Unusual Whales as the data source when UNUSUAL_WHALES_API_KEY is set.

Multi-Asset Strategies

Combine prediction markets and equities in one strategy:
Orders route to the correct exchange based on market.exchange. The engine tracks positions and P&L across all exchanges in a single book.

What Works the Same

These features work identically for equities and prediction markets:
  • Pipeline composition: chain functions, automatic signature introspection
  • Risk pipeline: all 8 checks (kill switch, price/size, position, notional, drawdown, rate limit, dedup)
  • Order management: submit, cancel, amend, bracket orders, stop-loss, take-profit
  • Position tracking: real-time P&L, exposure calculations
  • Persistence: SQLite crash recovery, fill journal, position snapshots
  • Monitoring: Prometheus metrics, alerts, TUI dashboard
  • Backtesting: hz.backtest() with the same pipeline
  • Autonomous fund: FundManager, strategy lifecycle, oversight loop