'Search through the tick entries in the price levels
:param tick_entry: The tick entry to match against
:param quantity_to_trade: The quantity still to be matched
:param order: The order to match for
:type tick_entry: TickEntry
:type quantity_to_trade: Quantity
:type order: Order
:return: The quantity to trade and the proposed trades
:rtype: Quantity, [ProposedTrade]'

def _search_for_quantity_in_price_level(self, tick_entry, quantity_to_trade, order):

    if (tick_entry is None):
        return (quantity_to_trade, [])
    if (order.order_id.trader_id == tick_entry.order_id.trader_id):
        return (quantity_to_trade, [])
    assert isinstance(tick_entry, TickEntry), type(tick_entry)
    assert isinstance(quantity_to_trade, Quantity), type(quantity_to_trade)
    assert isinstance(order, Order), type(order)
    if (tick_entry.order_id in order.reserved_ticks):
        return self._search_for_quantity_in_price_level(tick_entry.next_tick, quantity_to_trade, order)
    if (quantity_to_trade <= tick_entry.quantity):
        (quantity_to_trade, proposed_trades) = self._search_for_quantity_in_price_level_total(tick_entry, quantity_to_trade, order)
    else:
        (quantity_to_trade, proposed_trades) = self._search_for_quantity_in_price_level_partial(tick_entry, quantity_to_trade, order)
    return (quantity_to_trade, proposed_trades)
