from collections.abc import AsyncIterator from typing import Protocol from app.bars.models import Bar, Timeframe class MarketDataSource(Protocol): name: str delay_minutes: int def supports_history(self) -> bool: ... async def history( self, symbol: str, tf: Timeframe, start: int | None, end: int | None, *, range_: str | None = None, ) -> list[Bar]: ... def supports_stream(self) -> bool: ... def stream(self, symbol: str) -> AsyncIterator[Bar]: ...