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.
17 lines
512 B
Python
17 lines
512 B
Python
from __future__ import annotations
|
|
|
|
from app.config import Settings
|
|
from app.market.base import MarketData
|
|
from app.market.binance import BinanceMarketData
|
|
from app.market.fake import FakeMarketData
|
|
|
|
|
|
def build_market_data(settings: Settings) -> MarketData:
|
|
exchange = settings.exchange.lower()
|
|
if exchange in {"binance", "binanceus"}:
|
|
return BinanceMarketData()
|
|
raise ValueError(f"unsupported exchange: {settings.exchange}")
|
|
|
|
|
|
__all__ = ["FakeMarketData", "MarketData", "build_market_data"]
|