def _bounce(open, close, level, previous_touch):
    """
    did we bounce above the given level
    :param open:
    :param close:
    :param level:
    :param previous_touch
    :return:
    """
    if previous_touch == 1 and open > level and close > level:
        return 1
    elif previous_touch == 1 and open < level and close < level:
        return -1
    else:
        return 0
