diff --git a/README.md b/README.md index d671c6d..953b412 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Seed data: `python -m services.symbol_registry.seed` ## Features ### Autonomous Trading Engine -Continuous decision loop that polls for actionable recommendations and executes paper trades without manual intervention. Includes confidence-based position sizing, dynamic stop-loss/take-profit (ATR-based), circuit breakers (daily loss cap, single-position loss, volatility detection), reserve pool management (auto-siphon from profits), risk tier auto-adjustment (conservative/moderate/aggressive based on trailing performance), portfolio rebalancing (sector and concentration limits), gradual entry (multi-tranche orders), correlation-aware diversification, earnings calendar awareness, portfolio heat management, tax-lot tracking with wash sale detection, performance tracking (Sharpe, drawdown, win rate, profit factor), and backtesting against historical data. +Continuous decision loop that polls for actionable recommendations and executes paper trades without manual intervention. Includes confidence-based position sizing (with sample-size-dampened agreement scoring to prevent thin-evidence inflation), dynamic stop-loss/take-profit (ATR-based), circuit breakers (daily loss cap, single-position loss, volatility detection), reserve pool management (auto-siphon from profits), risk tier auto-adjustment (conservative/moderate/aggressive based on trailing performance), portfolio rebalancing (sector and concentration limits), gradual entry (multi-tranche orders), correlation-aware diversification, earnings calendar awareness, portfolio heat management, tax-lot tracking with wash sale detection, performance tracking (Sharpe, drawdown, win rate, profit factor), and backtesting against historical data. ### Global News Interpolation Macro/geopolitical event ingestion from dedicated sources. Ollama-based classification by impact type, severity, affected regions, and sectors. Company exposure profiles (geographic revenue mix, supply chain regions, commodity dependencies, market position tier) map events to per-company macro impact scores with resilience modifiers. Forward-looking trend projections combine company momentum with macro trajectories. @@ -104,7 +104,8 @@ Historical pattern mining on the platform's own data — how similar catalyst ty - Forward-looking trend projections with driving factor explanations ### Paper Trading -- $100k paper capital via Alpaca integration +- Alpaca paper trading integration (3 accounts max per Alpaca owner) +- Full reset: liquidates broker positions, cancels orders, syncs capital from broker balance - Moderate risk tier default, auto-adjustable - Full execution audit trail from signal to broker response - Operator approval workflow available for live mode diff --git a/docs/notes/runbook.md b/docs/notes/runbook.md index a62fc9d..78c4c31 100644 --- a/docs/notes/runbook.md +++ b/docs/notes/runbook.md @@ -132,6 +132,33 @@ curl -X PUT https://stonks-trading.celestium.life/api/trading/config \ -d '{"enabled": true}' ``` +### Full paper trading reset +Liquidates all Alpaca positions, cancels open orders, wipes all local trading state (decisions, orders, positions, snapshots, backtests), and sets engine capital from the broker's actual account balance. + +```bash +# Reset and sync capital from broker +curl -X POST https://stonks-trading.celestium.life/api/trading/reset \ + -H 'Content-Type: application/json' \ + -d '{}' + +# Or override with a specific capital amount +curl -X POST https://stonks-trading.celestium.life/api/trading/reset \ + -H 'Content-Type: application/json' \ + -d '{"initial_capital": 100000}' +``` + +Note: if the market is closed, Alpaca liquidation orders will be queued and fill at next market open. The engine capital is set immediately. + +### Switching to a new Alpaca paper account +Alpaca allows up to 3 paper accounts. To start fresh: +1. Go to https://app.alpaca.markets +2. Click paper account number → "Open New Paper Account" +3. Generate new API keys +4. Update secrets on gremlin-1: `alpaca.key`, `alpaca.secret`, `alpaca.url` +5. Re-run `runmefirst.sh` or `helm upgrade` with new `--set` values +6. Restart broker-adapter: `kso rollout restart deployment/broker-adapter` +7. Hit the reset endpoint to sync engine state with the new account + ### Check recent trading decisions ```bash curl -s https://stonks-api.celestium.life/api/trading/decisions?limit=10