trader.marketdata.base module

The market-data interface the Core Service Layer depends on.

A Protocol keeps yfinance and pandas out of the Core, so additional providers can be added later (requirements §7 wants extensible sources).

class trader.marketdata.base.MarketDataProvider(*args, **kwargs)[source]

Bases: Protocol

Live and historical price data.

get_quote(symbol)[source]

Return the most recent observed price for symbol.

Parameters:

symbol (str)

Return type:

Quote

get_history(symbol, start, end, interval='1d')[source]

Return OHLCV bars for symbol between start and end.

Parameters:
  • symbol (str)

  • start (date)

  • end (date)

  • interval (str)

Return type:

list[Bar]