Getting Started
Run a backtest in the dashboard
Open agentic-trading-lab.vercel.app or http://localhost:8000/ when running locally. Stay on the Backtest tab.
Set the date range, assets, and model in the left sidebar.
Click Run Backtest.
Wait for completion—the UI polls
/backtest/statusand reloads equity charts when done.
Results appear in Trading Performance (agent vs. buy-and-hold vs. DJIA).
CLI backtest (optional)
For headless or scripted runs:
python3 scripts/backtest_hourly_agent.py --start 2026-03-01 --end 2026-03-31
python3 scripts/backtest_hourly_agent.py --mode buy_and_hold
Inspect results in the dashboard after a CLI run, or call POST /backtest/run with the same parameters the UI sends.
Local deployment
Install dependencies
pip install -r requirements.txt
Configure Alpaca credentials
Use either environment variables or a local credentials file.
Option A — ``.env`` (recommended for deploy):
cp .env.example .env
# ALPACA_API_KEY=...
# ALPACA_SECRET_KEY=...
# ALPACA_BASE_URL=https://paper-api.alpaca.markets
Option B — credentials file (CLI and local API fallback):
cp credentials/alpaca.json.example credentials/alpaca.json
The credentials/ directory is not tracked in git. See credentials/README.md.
Start the API server
python3 backend/app.py
Open the dashboard at http://localhost:8000/.