trading/services/api_gateway/routes
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
..
__init__.py feat: API gateway trading endpoints, controls, backtest, WebSocket 2026-02-22 15:54:20 +00:00
backtest.py feat: make backtest work end-to-end with Alpaca bars, ticker selection, all 9 strategies 2026-02-23 22:25:41 +00:00
controls.py feat: API gateway trading endpoints, controls, backtest, WebSocket 2026-02-22 15:54:20 +00:00
meet_kevin.py fix(meet-kevin): API smoke-test bugs from Task 17 QA 2026-05-21 20:15:08 +00:00
meet_kevin_backtest.py feat(backtest): wire real Alpaca historical fetcher 2026-05-26 21:09:40 +00:00
meet_kevin_strategy.py feat(api): /api/meet-kevin/strategy/* routes 2026-05-24 01:12:16 +00:00
news.py fix: news articles showing 1970 dates when published_at is null 2026-02-23 22:48:16 +00:00
portfolio.py fix: resolve all remaining TODOs, add dev mode auth bypass 2026-02-25 22:02:25 +00:00
signals.py feat: API gateway trading endpoints, controls, backtest, WebSocket 2026-02-22 15:54:20 +00:00
strategies.py feat: productionize local service — fix signal pipeline, lower thresholds, add company-name ticker extraction 2026-02-22 22:17:26 +00:00
trades.py feat: productionize local service — fix signal pipeline, lower thresholds, add company-name ticker extraction 2026-02-22 22:17:26 +00:00