Files
AITrading/python-app/app/market/provider_base.py
2026-03-26 14:13:44 +08:00

31 lines
725 B
Python

from __future__ import annotations
from abc import ABC, abstractmethod
from datetime import datetime
import pandas as pd
class MarketDataProvider(ABC):
@property
@abstractmethod
def provider_name(self) -> str:
raise NotImplementedError
@property
@abstractmethod
def channel(self) -> str:
raise NotImplementedError
@abstractmethod
def fetch_spot(self) -> pd.DataFrame:
raise NotImplementedError
@abstractmethod
def search_spot(self, query: str, limit: int) -> pd.DataFrame:
raise NotImplementedError
@abstractmethod
def fetch_daily_kline(self, code: str, start: datetime, end: datetime) -> pd.DataFrame:
raise NotImplementedError