Files
trading-agent/scripts/install_launchd.sh
Aryan Singh e1ac514f30 Add dynamic agent registry and options mandate
Introduces a dashboard-managed agent registry (`state/agents.json`) used by nightly research and market-open execution, including support for custom/disabled agents and per-agent time budgets. Expands personas to four agents (adds Maverick), shifts pick targets to include mandatory options, and updates prompts/finalization nudges to enforce option research without hard-failing runs.

Strengthens execution safety by adding option-specific guardrails (conviction floor, premium cap, reserved option slot through trade/day/buying-power caps), validates OCC option symbols in schemas, and normalizes invalid option direction cases. The dashboard was refactored into modular views, adds an Agents admin tab, and improves live portfolio visibility with Alpaca-first data and snapshot fallback.
2026-07-07 22:00:20 -05:00

31 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# Install the launchd jobs (caffeinate, nightly research, market-open execution).
set -euo pipefail
PROJ="/Users/aryan/Documents/GitHub/trading-agent"
LA="$HOME/Library/LaunchAgents"
mkdir -p "$LA" "$PROJ/state/logs"
chmod +x "$PROJ/scripts/nightly.sh" "$PROJ/scripts/execute.sh"
for p in caffeinate nightly market_open; do
cp "$PROJ/launchd/ai.tradingagent.$p.plist" "$LA/"
launchctl unload "$LA/ai.tradingagent.$p.plist" 2>/dev/null || true
launchctl load "$LA/ai.tradingagent.$p.plist"
echo "loaded ai.tradingagent.$p"
done
cat <<'EOF'
── ONE-TIME MANUAL STEP (needs sudo) ─────────────────────────────
Wake the Mac nightly at 23:55 CT so the 00:00 job can fire:
sudo pmset repeat wakeorpoweron MTWRFSU 23:55:00
── REQUIREMENTS for overnight runs ───────────────────────────────
• plugged into AC power
• lid OPEN (caffeinate can't beat clamshell sleep on a laptop)
• logged in (lock screen is fine; logged out = jobs won't run)
• oMLX running with a model available (it auto-starts on login)
• .env populated with Alpaca paper + Finnhub keys
──────────────────────────────────────────────────────────────────
EOF