def first_signal(stock_data, base_price, gain_loss_threshold):
    """
    This function detects the first market signal after certain days. If the price went above the threshold we set
    return 1. If the price went below we return -1. If the price did not go either way we return 0
    :param stock_data: a list of dicts. each dictionary needs to have the keys: high, low
    :param base_price: a number with regards the base price we are comparing to
    :param gain_loss_threshold: a percentage we set to be the sell/buy point
    :return: 1, 0, or -1
    """
    for d in stock_data:
        if d["high"] > base_price * (1 + gain_loss_threshold):
            return 1
        if d["low"] < base_price * (1 - gain_loss_threshold):
            return -1
    return 0