Skip to main content
Horizon provides a full-featured CLI for trading, discovery, wallet analytics, fund management, and strategy execution.
For the complete CLI reference with all commands, see the CLI Integration Guide.

Install

pip install horizon-sdk

Running Strategies

horizon run <strategy_file> [OPTIONS]
FlagValuesDefaultDescription
--modepaper, livefrom strategyOverride trading mode
--dashboard / --no-dashboard-from strategyOverride dashboard setting
--log-leveldebug, info, warn, errorinfoLog level for Python + Rust
CLI options always take priority over the strategy file’s hz.run() arguments.
horizon run examples/simple.py --dashboard

Trading from the CLI

# Search markets
horizon discover "bitcoin" --exchange polymarket

# Discover equities
horizon discover "AAPL" --exchange alpaca

# Get Kelly-optimal size
horizon kelly --prob 0.65 --price 0.50 --bankroll 1000

# Submit an order
horizon submit --market-id will-btc-hit-100k --side buy --price 0.55 --size 10

# Check positions
horizon positions

# Cancel everything
horizon cancel-all

Wallet Analytics

# Check wallet value
horizon wallet value 0x1234...abcd

# See trade history
horizon wallet trades 0x1234...abcd --limit 20

# Score trading performance
horizon wallet score 0x1234...abcd

Fund Management

# Deploy a strategy
horizon fund deploy --name my-mm --markets will-btc-hit-100k

# Check fund status
horizon fund status

# View risk dashboard
horizon fund risk

Equity & Options

# Stock quote
horizon equity quote AAPL

# Search stocks
horizon equity search "apple"

# Options chain
horizon equity options-chain AAPL --expiry 2026-04-17

# Greek exposure
horizon equity greeks SPY

# IV term structure
horizon equity iv-surface TSLA

# Stock screener
horizon equity screener --sector tech

JSON Output

Every command supports --json for scripting:
horizon discover "election" --json | jq '.[0].slug'
horizon top-markets --json | jq '[.[] | {slug, yes_price}]'

Database Commands

For offline analysis of persisted strategy data:
# Show fills from database
horizon db fills --path ./horizon.db --limit 20

# Show positions
horizon db positions --path ./horizon.db

# Show orders
horizon db orders --path ./horizon.db --all

How CLI Overrides Work

When running strategies, the CLI sets overrides in the _cli_overrides dictionary before loading the strategy module:
  1. CLI parses --mode and --dashboard flags
  2. Overrides are stored in horizon.strategy._cli_overrides
  3. The strategy file is loaded and executed
  4. When hz.run() is called, it reads _cli_overrides and applies them
This means hz.run() in the strategy file always runs. The CLI just changes its arguments.

All Commands

Run horizon --help for the full command list, or see the CLI Integration Guide for detailed documentation of all 50+ commands.