def get_latest_prices(self):
        """ Fetches the latest prices for all symbols """
        # get all symbols first, for which we have prices available
        from .repositories import PriceRepository

        repo = PriceRepository(self.__session)

        query = (
            repo.session.query(dal.Price.namespace, dal.Price.symbol)
            .order_by(dal.Price.namespace, dal.Price.symbol)
            .distinct()
        )
        all_symbols = query.all()
        # self.logger.debug(all_symbols)

        # Get the latest prices for these symbols
        latest_prices = []
        for symbol_price in all_symbols:
            symbol = SecuritySymbol(symbol_price.namespace, symbol_price.symbol)
            latest = self.get_latest_price(symbol)
            latest_prices.append(latest)
        return latest_prices
def get_latest_prices ( self ) : from . repositories import PriceRepository repo = PriceRepository ( self . __session ) query = ( repo . session . query ( dal . Price . namespace , dal . Price . symbol ) . order_by ( dal . Price . namespace , dal . Price . symbol ) . distinct ( ) ) all_symbols = query . all ( ) latest_prices = [ ] for symbol_price in all_symbols : symbol = SecuritySymbol ( symbol_price . namespace , symbol_price . symbol ) latest = self . get_latest_price ( symbol ) latest_prices . append ( latest ) return latest_prices
Fetches the latest prices for all symbols