v1.1 autonomous upgrade: continuous curation, risk engine, scheduler hardening, systemd service

This commit is contained in:
2026-02-25 19:09:05 -08:00
parent cce199d73a
commit 4d17bf8018
14 changed files with 209 additions and 59 deletions

View File

@@ -1,33 +1,50 @@
# alpaca-llm-bot-v1
Autonomous 2-hour trading loop powered by:
Autonomous LLM trading system (paper-first) powered by:
- Alpaca trading API
- Ollama local model inference
- Searx web data ingestion
- FastAPI dark dashboard
- APScheduler autonomous loops
## Safety defaults
- `PAPER_MODE=true`
- max order notional `$5`
- confidence gate `>= 0.55` before order placement
## Autonomous behavior
- Curates market/news context every `CURATE_INTERVAL_MINUTES` (default 30)
- Runs trade decision cycle every `TRADE_INTERVAL_HOURS` (default 2)
- LLM decides buy/sell/hold per symbol
- Executes only if confidence >= `MIN_CONFIDENCE`
- Hard risk caps:
- max `$5` order notional (default)
- max daily notional cap
- max open positions cap
- market-open gate
## Quick start
```bash
cp .env.example .env
# fill ALPACA_API_KEY / ALPACA_API_SECRET
chmod +x run.sh
./run.sh
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 8089
```
Open dashboard:
Dashboard:
- `http://<host>:8089/`
Trigger immediate cycle:
Manual triggers:
```bash
curl -X POST http://127.0.0.1:8089/curate-now
curl -X POST http://127.0.0.1:8089/run-now
```
## Production notes
- Put behind reverse proxy + auth
- Keep paper mode until behavior validated
- Add hard stop-loss and max daily drawdown before enabling live mode
## Production service (systemd)
```bash
sudo cp systemd/alpaca-llm-bot-v1.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now alpaca-llm-bot-v1
sudo systemctl status alpaca-llm-bot-v1
```
## Important
- Keep `PAPER_MODE=true` until you observe stable behavior.
- This is experimental and not financial advice.