trading/services
Viktor Barzin bcd0857729
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat(backtest): wire real Alpaca historical fetcher
Previously the backtest API instantiated a _NoAlpaca stub that
returned an empty DataFrame for every fetch_daily_bars call, so the
mention-driven engine had no price data to mark trades against and
every backtest reported total_return=0 / trade_count=0.

Replace with _AlpacaHistoricalFetcher which:
- Uses StockHistoricalDataClient (alpaca-py) with Day timeframe
- Reads creds from TRADING_ALPACA_API_KEY/SECRET_KEY env vars (already
  injected via trading-bot-secrets ESO)
- DataFeed.IEX (free tier — same as services/market_data uses)
- Lazy-instantiates the SDK clients on first use to avoid import cost
  in the api-gateway hot path
- Returns indexed DataFrame matching KevinPriceLoader's expected shape
  ([open, high, low, close, volume], timestamp index)
- Returns empty DataFrame on Alpaca failure (loader has its own
  cache-miss fallback that no-ops gracefully)

is_asset_tradable also wired to the real Alpaca TradingClient so the
backtest doesn't trade non-tradable tickers.
2026-05-26 21:09:40 +00:00
..
api_gateway feat(backtest): wire real Alpaca historical fetcher 2026-05-26 21:09:40 +00:00
kevin_signal_bridge fix(kevin_bridge): use PositionInfo.ticker + qty*avg_entry for cost basis 2026-05-24 01:22:40 +00:00
learning_engine
market_data
meet_kevin_watcher
news_fetcher
sentiment_analyzer
signal_generator
trade_executor feat(phase2): BRACKET orders + Kevin risk caps (Tasks 18, 19) 2026-05-26 21:03:59 +00:00
__init__.py