Files
momentum-system/.env.example
T
momentum devandClaude Opus 4.8 020eec7f96 WS5 Grafana dashboards + RSS news-catalyst discovery
- grafana/: docker-compose + provisioned Postgres datasource + 'Momentum — Live'
  dashboard (evaluation board with status colours, ready signals, risk events,
  bars + equity timeseries) reading the event store via JSONB extraction.
  Run: cd grafana && docker compose up -d -> http://localhost:3000.
- RSS news-catalyst discovery wired: extract_tickers also matches $CASHTAGS;
  run_discovery pulls tickers from recent news into the universe when NEWS_FEEDS
  is set (no-op / safe otherwise).
- docs: .env.example NEWS_FEEDS; GO_LIVE monitoring adds 'momentum watch' + Grafana.

67/67 tests green. Live board (momentum watch) verified rendering the evaluation
board with real determinations.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 09:00:22 -04:00

90 lines
3.6 KiB
Bash

# ============================================================
# Momentum — environment configuration (copy to .env and fill)
# ============================================================
# ---- Database (PostgreSQL) — the single datastore (event store + bar warehouse)
# Either a full URL:
DATABASE_URL=postgresql://USER:PASSWORD@HOST:5432/momentum
# ...or individual vars (used only if DATABASE_URL is unset):
# PGHOST=127.0.0.1
# PGPORT=5432
# PGUSER=admin
# PGPASSWORD=
# PGDATABASE=momentum
# ---- Alpaca (market data + paper broker) — REQUIRED for live paper trading
ALPACA_API_KEY=
ALPACA_SECRET_KEY=
# Alpaca paper trading endpoint (default is fine)
APCA_API_BASE_URL=https://paper-api.alpaca.markets
# These two aliases are also read by the paper client:
APCA_API_KEY_ID=
APCA_API_SECRET_KEY=
# ---- Schwab (live broker, Milestone 3) — OPTIONAL for paper trading
SCHWAB_MARKET_DATA_APP_KEY=
SCHWAB_MARKET_DATA_APP_SECRET=
SCHWAB_BROKER_APP_KEY=
SCHWAB_BROKER_APP_SECRET=
SCHWAB_REDIRECT_URI=
SCHWAB_TOKEN_PATH=data/schwab_tokens.json
# ---- Optional research / news providers
POLYGON_API_KEY=
FINNHUB_API_KEY=
Alpha_Vantage_Api_Key=
# News-catalyst discovery (optional): RSS feeds as name=url, comma-separated.
# When set, tickers mentioned in recent news ($TICKER or (NASDAQ:TICKER)) are
# added to the watchlist. Unset = disabled (no effect on the loop).
# NEWS_FEEDS=prnewswire=https://www.prnewswire.com/rss/news-releases-list.rss,businesswire=https://feed.businesswire.com/rss/home/?rss=G1QFDERJXkJeGVtRWQ==
# ============================================================
# Live paper-trading orchestrator (run_live_paper.py)
# ============================================================
# Execution destination: alpaca_paper (safe) or schwab_live (REAL MONEY)
TRADING_EXECUTION_MODE=alpaca_paper
TRADING_EXECUTION_ENABLED=1
TRADING_EXECUTION_INTERVAL_SECONDS=30
TRADING_AUTO_APPROVE=0 # 0 = manual approval in the dashboard, 1 = auto-arm (no approval)
TRADING_MAX_ORDERS_PER_TICK=1
TRADING_MAX_CONCURRENT_POSITIONS=3
TRADING_RISK_PER_TRADE_PCT=0.01 # fraction of equity risked per trade
# --- entry mechanism (Ross-Cameron-style auto-arm; all tunable) ---
TRADING_REWARD_MULTIPLE=2.0 # target = entry + this * (entry - stop); 2R default
TRADING_ENTRY_ORDER_TYPE=limit # limit = rest at trigger (cancellable); market = fill now
TRADING_ENTRY_TIMEOUT_BARS=2 # cancel an unfilled entry after N minutes resting (0 = off)
TRADING_ENTRY_INVALIDATE_PCT=0.0 # cancel if price breaks this far below entry (0 = any break; <0 = off)
TRADING_ENTRY_GUARD_INTERVAL_SECONDS=5 # how often to re-check armed entries vs the LIVE last-trade price
TRADING_MAX_DAILY_LOSS_PCT=0.03 # daily-loss circuit breaker
# Intraday watcher (signal engine)
WATCHER_ENABLED=1
WATCHER_INTERVAL_SECONDS=60
# WATCHER_EVENT_DB_PATH is legacy and ignored — the datastore is PostgreSQL (see DATABASE_URL above)
WATCHER_MAX_SYMBOLS=25
WATCHER_MIN_BARS=30
WATCHER_MIN_QUALITY=0.30
# Comma-separated symbols to follow all day. If empty, candidates are
# discovered from whatever has minute bars in market.duckdb for today.
WATCHER_SYMBOLS=AAPL,TSLA,NVDA,AMD,SOFI
# Price band for auto-discovered candidates (Ross Cameron default 1-20).
WATCHER_PRICE_MIN=1
WATCHER_PRICE_MAX=20
# Live minute-bar ingestion (feeds the watcher with active market data)
LIVE_BARS_ENABLED=1
LIVE_BARS_INTERVAL_SECONDS=60
LIVE_BARS_LOOKBACK_MINUTES=120
# Broker state sync
ALPACA_PAPER_SYNC_ENABLED=1
ALPACA_PAPER_SYNC_INTERVAL_SECONDS=60
ACCOUNT_SYNC_ENABLED=0 # Schwab live account sync
ORDER_SYNC_ENABLED=0 # Schwab live order sync
# Dashboard
DASHBOARD_HOST=0.0.0.0
DASHBOARD_PORT=8010