def check_stc_order(order, symbol):
    """Return order id if order has an in-effect STC order
    for input symbol, else return None"""
    if order["status"] in ["WORKING", "QUEUED", "ACCEPTED"]:
        if len(order["orderLegCollection"]) == 1:  # no multi-leg orders
            instruct = order["orderLegCollection"][0]["instruction"]
            ord_symbol = order["orderLegCollection"][0]["instrument"]["symbol"]
            if ord_symbol == symbol and instruct == "SELL_TO_CLOSE":
                return str(order["orderId"])