trading/.env.example
Viktor Barzin e2a3bd456d
feat: real data pipeline — market data, DB persistence, portfolio sync, signal-trade linkage
Wire the trading bot to real Alpaca market data and persist pipeline
state to the database so the dashboard displays live information.

- Add market-data service fetching OHLCV bars from Alpaca, publishing
  to market:bars Redis Stream; signal generator consumes bars and
  injects current_price into signals for position sizing
- Sentiment analyzer now persists Article + ArticleSentiment rows to
  DB after scoring, with duplicate and error handling
- API gateway runs a background portfolio sync task that snapshots
  Alpaca account state into PortfolioSnapshot/Position DB tables
  during market hours
- TradeSignal carries a signal_id UUID; signal generator and trade
  executor both persist their records to DB with cross-references
- 303 unit tests pass (57 new tests added)
2026-02-22 19:52:45 +00:00

38 lines
1.2 KiB
Text

# PostgreSQL
POSTGRES_PASSWORD=trading
# Trading Bot — shared config (env_prefix = "TRADING_")
TRADING_DATABASE_URL=postgresql+asyncpg://trading:trading@postgres:5432/trading
TRADING_REDIS_URL=redis://redis:6379/0
TRADING_LOG_LEVEL=INFO
# Alpaca (paper trading)
TRADING_ALPACA_API_KEY=your_api_key_here
TRADING_ALPACA_SECRET_KEY=your_secret_key_here
TRADING_ALPACA_BASE_URL=https://paper-api.alpaca.markets
TRADING_PAPER_TRADING=true
# Market data service — watchlist tickers (comma-separated)
TRADING_WATCHLIST=["AAPL","TSLA","NVDA","MSFT","GOOGL"]
TRADING_BAR_TIMEFRAME=5Min
TRADING_POLL_INTERVAL_SECONDS=60
TRADING_HISTORICAL_BARS=100
# Portfolio sync interval (seconds, api-gateway background task)
TRADING_SNAPSHOT_INTERVAL_SECONDS=60
# JWT — REQUIRED, generate with: python -c "import secrets; print(secrets.token_hex(32))"
TRADING_JWT_SECRET_KEY=
# Reddit (for news fetcher)
TRADING_REDDIT_CLIENT_ID=your_client_id
TRADING_REDDIT_CLIENT_SECRET=your_client_secret
TRADING_REDDIT_USER_AGENT=trading-bot/0.1
# Ollama — use Docker service name inside compose
TRADING_OLLAMA_HOST=http://ollama:11434
# WebAuthn — update for production domain
TRADING_RP_ID=localhost
TRADING_RP_NAME=Trading Bot
TRADING_RP_ORIGIN=http://localhost:5173