FastAPI backend with a single-strategy async engine, paper and Binance brokers, pure-python indicators, a backtester that shares the engine's portfolio math, and a Vue dashboard with a live WebSocket feed. Adds the Gitea Actions CI/CD workflow that deploys to Traefik via docker_default.
21 lines
505 B
Python
21 lines
505 B
Python
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
from app.schemas import Candle
|
|
|
|
|
|
class MarketData(ABC):
|
|
"""Read-only market data source (candles + last price)."""
|
|
|
|
@abstractmethod
|
|
async def fetch_candles(self, symbol: str, timeframe: str, limit: int) -> list[Candle]:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
async def fetch_price(self, symbol: str) -> float:
|
|
raise NotImplementedError
|
|
|
|
async def close(self) -> None:
|
|
return None
|