def get_allowed(group, symbol, direction): """ Determine whether the trade is allowed according to the Asset Groups linked to the strategy. """ # TODO: figure out what to do with direction allowed = group.allowed if not isinstance(allowed, dict): return False if symbol not in allowed: return True return allowed[symbol]