Skip to main content
Horizon includes a real-time TUI (Terminal User Interface) dashboard built with Textual. It displays P&L, positions, orders, risk status, fills, and feeds in a 2x3 grid layout.

Enable the Dashboard

hz.run(dashboard=True, ...)
Or from the CLI:
python -m horizon run strategy.py --dashboard

Panels

The dashboard displays 7 panels in a 2x4 grid:
PanelContent
P&LRealized, unrealized, total, and daily P&L with equity sparkline
PositionsMarket, side, size, entry price, P&L color-coded (up to 10)
OrdersOpen orders with side, price, size, market (up to 10)
RiskPosition count, order count, kill switch status, uptime
FillsRecent fills with side, size, price (last 10)
FeedsFeed names, bid/ask spread, staleness indicator
AlertsRecent alerts (stale feeds, lifecycle events, state changes)

Keybindings

KeyAction
qQuit the strategy
kToggle kill switch on/off
pPause/Resume strategy execution

How It Works

The dashboard runs the strategy loop inside the Textual app’s timer:
  1. A set_interval(interval) timer fires each cycle
  2. Each tick: poll fills → update P&L → run pipeline → process results → update panels
  3. Positions are snapshotted to the database every 50 ticks
  4. All 6 panels are refreshed after each tick
The dashboard uses the same _build_context(), _run_pipeline(), and _process_result() functions as the console mode. Same strategy logic, different display.
The dashboard requires textual>=0.40. If not installed, Horizon falls back to console mode with a warning message.

Dashboard vs Console Mode

FeatureConsoleDashboard
Strategy executionSameSame
Status outputEvery 10 cycles to stdoutReal-time panels
Kill switchNot accessiblePress k to toggle
Pause/ResumeNot availablePress p to toggle
QuitCtrl+Cq or Ctrl+C
Feed displayLogged at debug levelLive panel with staleness
AlertsLogged to consoleDedicated alerts panel