24 lines
519 B
Python
24 lines
519 B
Python
from collections.abc import AsyncIterator
|
|
from typing import Protocol
|
|
|
|
from app.bars.models import Bar, Timeframe
|
|
|
|
|
|
class MarketDataSource(Protocol):
|
|
name: str
|
|
|
|
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]: ...
|