def _get_alert(lb, ub, price_old, price_new):
    """
    Filter function to determine whether bounds were crossed.
    :param lb: Lower bound for alert.
    :param ub: Upper bound for alert.
    :param price_old: Old stock price.
    :param price_new: New stock price.
    :return: tuple of data if bounds were crossed. Otherwise None.
    """

    if (price_old <= ub < price_new) or (price_new < lb <= price_old):
        return lb, ub, price_old, price_new