Real-Time Dashboard
KlawTrade includes a web-based trading dashboard that updates in real time over WebSockets. Once the engine is running, open your browser to view live portfolio data, manage positions, and monitor system health -- all without refreshing the page.
Accessing the Dashboard
The dashboard starts automatically when you launch the trading engine. Open it in any modern browser:
http://localhost:8080To change the port, update the dashboard.port setting in your configuration file. You can also access the dashboard remotely by binding to 0.0.0.0 instead of 127.0.0.1.
Dashboard Panels
The dashboard is organized into five main panels, each updating in real time as trades execute and market data flows in.
Equity Curve
A line chart showing your portfolio value over time. The curve updates tick by tick during market hours. It plots both the total equity and the benchmark (SPY by default) so you can see relative performance at a glance. Hover over any point to see the exact value, date, and percentage change.
Open Positions
A live table of all current holdings. Each row shows the ticker, quantity, entry price, current price, unrealized P&L (color-coded green or red), and position weight as a percentage of total equity. Positions are sorted by absolute P&L so the largest movers are always visible first.
Trade Log
A scrolling feed of every executed trade. Each entry includes the timestamp, ticker, side (buy/sell), quantity, fill price, strategy that generated the signal, and realized P&L for closing trades. You can filter by ticker, strategy, or date range. Export to CSV for external analysis.
Circuit Breaker Status
A panel displaying the status of all seven circuit breakers. Each trigger shows its current value, configured threshold, and a visual gauge. Green means healthy, yellow means approaching the limit, red means the breaker has tripped. When a breaker trips, the dashboard displays an alert banner and all trading halts automatically.
Kill Switch
A prominent red button that immediately halts all trading activity and flattens every open position. Use this as an emergency stop if you observe unexpected behavior. The kill switch sends market orders to close all positions and disables the strategy engine until you manually restart it. It requires a confirmation click to prevent accidental activation.
WebSocket Real-Time Updates
The dashboard connects to the trading engine over a persistent WebSocket connection. This means data flows to your browser the instant it is available -- no polling, no delays. The WebSocket protocol is lightweight and supports thousands of updates per second.
# Dashboard WebSocket configuration
dashboard:
port: 8080
host: "127.0.0.1"
ws_heartbeat: 30 # seconds between keepalive pings
max_connections: 5 # simultaneous browser sessions
update_interval: 250 # milliseconds between UI updatesIf the WebSocket connection drops (network interruption, laptop sleep), the dashboard reconnects automatically and fetches any missed state updates.
Configuration
Customize the dashboard through your config/settings.yaml file:
dashboard:
port: 8080
host: "127.0.0.1" # use "0.0.0.0" for remote access
theme: "dark" # dark or light
benchmark: "SPY" # equity curve comparison index
refresh_rate: 250 # ms between UI updates
trade_log_limit: 500 # max rows in trade log
auth:
enabled: false # enable basic auth for remote access
username: "admin"
password_hash: "" # bcrypt hash of your passwordRunning in Docker
When running KlawTrade in a Docker container, expose the dashboard port in your Docker run command:
docker run -p 8080:8080 klawtrade/klawtrade:latestThen access the dashboard at http://localhost:8080 as usual.
Next Steps
- Circuit Breakers -- understand the 7-trigger safety system shown in the dashboard
- Risk Management -- learn about the risk checks that run before every trade
- Backtesting -- validate strategies against historical data before going live
- Getting Started -- set up KlawTrade from scratch