Day_TraderDocumentation

Deployment Guide

Everything you need to run Day_Trader — locally, with Docker, or on a 24/7 cloud server.

Choose Your Path

PathBest ForCostEffortRuns 24/7?
Local PythonDevelopment, testing, quick startFreeEasyOnly when laptop is on
Local DockerCleaner local setup, matches cloud deploymentFreeEasyOnly when laptop is on
Oracle Cloud VPS ⭐Production, set-and-forget, always runningFreeMediumYes — always on
DigitalOcean DropletProduction, simpler setup than Oracle~$6/moEasyYes — always on

Recommendation: Start with Local Python to verify your API keys work, then migrate to Oracle Cloud for 24/7 operation.

Prerequisites (All Paths)

ItemWhere to Get ItRequired?
Alpaca API Key + Secretapp.alpaca.markets → Paper Trading → API KeysRequired
Alpha Vantage Keyalphavantage.co — free tierRecommended
NewsAPI Keynewsapi.org — free tierRecommended
FRED API Keyfred.stlouisfed.org — freeRecommended
Anthropic API Keyconsole.anthropic.comOptional (AI Advisor)

Path 1 — Local Python

The simplest way to get started. Requires Python 3.11+ installed on your machine.

# 1. Clone the repository
git clone https://github.com/BoxOfllc/Day_Trader.git
cd Day_Trader

# 2. Install dependencies
pip install -r requirements.txt

# 3. Configure environment
cp .env.example .env
# Open .env in any text editor and fill in your API keys

# 4. Run the scheduler (paper trading by default)
python scheduler.py

# 5. In a separate terminal, run the dashboard
python override_server.py

Open http://localhost:8000 to access the dashboard.

⚠ Sleep problem: If your computer sleeps, the scheduler pauses. For reliable 24/7 operation, use the Oracle Cloud path.

Path 2 — Local Docker

Requires Docker Desktop installed. Runs both services automatically.

# 1. Clone the repository
git clone https://github.com/BoxOfllc/Day_Trader.git
cd Day_Trader

# 2. Configure environment
cp .env.example .env
# Edit .env with your API keys

# 3. Create data files (required for bind mounts)
touch trading_journal.db
mkdir -p reports logs

# 4. Start everything
docker compose up -d --build

Open http://localhost:8000 to access the dashboard.

# Useful commands
docker compose logs -f          # Watch live logs from both services
docker compose ps               # Check service status
docker compose down             # Stop everything
docker compose up -d --build    # Rebuild and restart after git pull

Path 3 — Oracle Cloud VPS ⭐ Recommended

Runs 24/7 on a free Linux server. Never misses a market cycle. No laptop required.

Full step-by-step instructions: Oracle Cloud Free Tier Setup Guide — covers account creation, VM setup, networking, SSH, Docker deployment, and budget protection. ~30 minutes total.

Once set up, updating is one command:

cd ~/Day_Trader && git pull && sudo docker compose up -d --build

Path 4 — DigitalOcean

Same process as Oracle, but with a simpler UI and $6/month cost. Create a Basic Droplet with Ubuntu 22.04, then follow the same steps as the Oracle guide from "Connect via SSH" onward — the Linux setup is identical.

Common Operations

# Dry-run mode (test without placing orders)
python scheduler.py --dry-run

# View logs (Docker)
docker compose logs -f

# View logs (Local Python)
# Logs write to ./logs/trader_YYYY-MM-DD.log

# Backup the database
cp trading_journal.db trading_journal_backup_$(date +%Y%m%d).db

# Update to latest version (Docker)
git pull && docker compose up -d --build

# Update to latest version (Local Python)
git pull && pip install -r requirements.txt

# Stop (Docker)
docker compose down

# Stop (Local Python)
# Press Ctrl+C in the terminal running scheduler.py

Paper → Live Checklist

Do not switch ALPACA_PAPER_MODE to false until all of these are checked:

Architecture

Day_Trader is a 7-agent autonomous trading swarm. Agents communicate via shared state (SQLite + in-memory). No trade executes without SENTINEL approval.

AgentFileRole
ORACLEagents/oracle.pyMaster orchestrator. Processes your commands. Coordinates all other agents.
RADARagents/radar.pyIntelligence gathering. News, sentiment, macro conditions, government contracts.
QUANTagents/quant.pySignal generation. Runs 8 technical indicators, scores signals 0–1. Includes 4-phase options strategy.
SENTINELagents/sentinel.pyRisk manager. Approves/rejects every trade. Kelly Criterion sizing, circuit breakers.
LEDGERagents/ledger.pyPortfolio monitor. Tracks P&L, generates daily Commander's Report at 6:30 PM ET.
EXECUTORagents/executor.pyTrade execution via Alpaca (equities/options) and Coinbase (crypto).
RETROSPECTIVEagents/retrospective.pyWeekly self-improvement. Analyses closed trades, flags anomalies, bounded auto-tunes.

Data Sources

Day_Trader degrades gracefully — only Alpaca is required. All other sources are optional and enhance signal quality when available.

Required

SourceKeyCostUsed for
Alpaca MarketsALPACA_API_KEY + ALPACA_SECRET_KEYFreeOrder execution, account data, real-time quotes

Optional — Free Tier

SourceKeyFree LimitUsed for
Alpha VantageALPHA_VANTAGE_KEY25 req/dayTechnical indicators, intraday data
FREDFRED_API_KEYUnlimitedMacro indicators (VIX supplement, yield curve)
NewsAPINEWS_API_KEY100 req/dayNews sentiment for watchlist tickers
Financial Modeling PrepFMP_API_KEY250 req/dayEarnings calendar with EPS estimates

Optional — Paid

SourceKeyCostUsed for
AnthropicANTHROPIC_API_KEYPay-per-tokenAI Advisor chat in the dashboard
Coinbase AdvancedCOINBASE_API_KEYTrading feesCrypto order execution (no sandbox — real money when paper=false)

Configuration Reference

All settings live in your .env file. Copy .env.example to get started.

VariableDescriptionRequired?
ALPACA_API_KEYAlpaca broker API keyYes
ALPACA_SECRET_KEYAlpaca broker secret keyYes
ALPACA_PAPER_MODEtrue for paper trading (safe default)Yes
OVERRIDE_API_KEYDashboard protection key — required for cloud. Generate: python -c "import secrets; print(secrets.token_urlsafe(32))"Cloud only
ALPHA_VANTAGE_KEYAlpha Vantage market data (free tier)Recommended
FRED_API_KEYFederal Reserve macro data (free)Recommended
NEWS_API_KEYNews sentiment analysis (free tier, 100 req/day)Recommended
ANTHROPIC_API_KEYEnables the AI Advisor chat in the dashboardOptional
ALERT_WEBHOOKDiscord or Slack webhook for circuit breaker alertsOptional
COINBASE_API_KEYCoinbase Advanced Trade (crypto). No sandbox — crypto orders are real when paper mode is false.Optional
OVERRIDE_SERVER_PORTDashboard port (default 8000)No
DB_PATHSQLite database path (default ./trading_journal.db)No

Accessing the Dashboard

DeploymentURL
Local (any path)http://localhost:8000
Oracle / DigitalOceanhttp://<your-server-ip>:8000

When OVERRIDE_API_KEY is set, the dashboard will prompt for the key on first load. It's stored in localStorage — you only enter it once per browser.

Day_Trader is not a registered investment advisor. All trading is performed by autonomous software agents at your own risk. Past performance is not indicative of future results. This software is provided for educational and personal use only. Not financial advice.

> DAY_TRADER // ILS
> initializing agent swarm
ORACLEONLINE
RADARONLINE
SENTINELONLINE
QUANTONLINE
LEDGERONLINE
> swarm online — markets never close_