ebff19940b
A new /regime tab scoring how far the AI/Tech bull regime has deteriorated toward a re-rating as a single 0-100 index with per-signal breakdown and a 7/30-day trend. Intentionally decoupled: nothing reads its output to gate or score trades — the daily-pipeline membership is scheduling only. - regime_monitor_service: price sub-scores (P1-P6 via Alpaca, like market_regime), VIX + HY credit spreads via a small FRED helper, weighted aggregation over available signals (missing source -> n/a, dropped from the denominator), one snapshot row/day, and a ~90-day history backfill by replaying the already-fetched series as-of each past day. - F1/F3 fundamentals proposed by the configured grounded LLM (reuses sentiment_provider_service config resolution), with a manual override + lock. - regime_snapshots table (migration 011); endpoints on the existing market router; admin-editable weights/threshold; standalone /regime page. Data needs: prices via Alpaca, VIX/credit via FRED (optional key — signals show n/a without it). No LLM needed for history. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
56 lines
1.3 KiB
Bash
56 lines
1.3 KiB
Bash
# Database
|
|
DATABASE_URL=postgresql+asyncpg://stock_backend:changeme@localhost:5432/stock_data_backend
|
|
|
|
# Auth
|
|
JWT_SECRET=change-this-to-a-random-secret
|
|
JWT_EXPIRY_MINUTES=60
|
|
|
|
# OHLCV Provider — Alpaca Markets
|
|
ALPACA_API_KEY=
|
|
ALPACA_API_SECRET=
|
|
|
|
# Sentiment Provider — Gemini with Search Grounding
|
|
GEMINI_API_KEY=
|
|
GEMINI_MODEL=gemini-2.0-flash
|
|
|
|
# Sentiment Provider — OpenAI
|
|
OPENAI_API_KEY=
|
|
OPENAI_MODEL=gpt-4o-mini
|
|
OPENAI_SENTIMENT_BATCH_SIZE=5
|
|
|
|
# Fundamentals Provider — Financial Modeling Prep
|
|
FMP_API_KEY=
|
|
|
|
# Fundamentals Provider — Finnhub (optional fallback)
|
|
FINNHUB_API_KEY=
|
|
|
|
# Fundamentals Provider — Alpha Vantage (optional fallback)
|
|
ALPHA_VANTAGE_API_KEY=
|
|
|
|
# Regime Monitor — FRED (VIX + HY credit spreads). Free key: https://fred.stlouisfed.org/docs/api/api_key.html
|
|
# Optional: without it the VIX (P5) and credit-spread (F2) signals show as n/a.
|
|
FRED_API_KEY=
|
|
|
|
# Scheduled Jobs
|
|
DATA_COLLECTOR_FREQUENCY=daily
|
|
SENTIMENT_POLL_INTERVAL_MINUTES=30
|
|
FUNDAMENTAL_FETCH_FREQUENCY=daily
|
|
RR_SCAN_FREQUENCY=daily
|
|
FUNDAMENTAL_RATE_LIMIT_RETRIES=3
|
|
FUNDAMENTAL_RATE_LIMIT_BACKOFF_SECONDS=15
|
|
|
|
# Scoring Defaults
|
|
DEFAULT_WATCHLIST_AUTO_SIZE=10
|
|
DEFAULT_RR_THRESHOLD=3.0
|
|
|
|
# Outcome Evaluation
|
|
# Trading days before an undecided setup expires at 0R
|
|
OUTCOME_EVALUATION_MAX_BARS=30
|
|
|
|
# Database Pool
|
|
DB_POOL_SIZE=5
|
|
DB_POOL_TIMEOUT=30
|
|
|
|
# Logging
|
|
LOG_LEVEL=INFO
|