def load_tick(self, vt_symbol: str, days: int, callback: Callable[[TickData], None]): """""" symbol, exchange = extract_vt_symbol(vt_symbol) end = datetime.now() start = end - timedelta(days) ticks = database_manager.load_tick_data( symbol=symbol, exchange=exchange, start=start, end=end, ) for tick in ticks: callback(tick)
def load_tick_data(symbol: str, exchange: Exchange, start: datetime, end: datetime): """""" return database_manager.load_tick_data(symbol, exchange, start, end)
def load_tick_data(spread: SpreadData, start: datetime, end: datetime): """""" return database_manager.load_tick_data(spread.name, Exchange.LOCAL, start, end)