Slide 29
Slide 29 text
code
Domain Layer
class AbstractApi(abc.ABC):
def __init__(self, market: Market):
self.market = market
@abc.abstractmethod
def buy_order(self, price: float, budget: float) -> Order:
raise NotImplementedError
@abc.abstractmethod
def sell_order(self, price: float, volume: float) -> Order:
raise NotImplementedError
@abc.abstractmethod
def cancel_order(self, order_id: str) -> str:
raise NotImplementedError
@abc.abstractmethod
def get_order(self, order_id: str) -> Order:
raise NotImplementedError
@abc.abstractmethod
def get_orders(self, order_ids: List[str]=None) -> List[Order]:
raise NotImplementedError
@abc.abstractmethod
def get_prices(self, unit: str='minute', counts: int=1, to: datetime=None) -> List[Price]:
raise NotImplementedError
@abc.abstractmethod
def get_balance(self) -> Balance:
raise NotImplementedError