def option_orders(client, options={}): ''' options: - only_filled. Default = True ''' x = OptionOrder.all(client) only_filled = util.get_key(options, "only_filled", True) if only_filled: x = list(filter(lambda j: j["state"] == "filled", x)) x = OptionOrder.humanize_numbers(x) return x
def option_orders(account, options={}): ''' options: - only_filled: ''' client = _init_client(account["username"], account["password"]) x = OptionOrder.all(client) only_filled = util.get_key(options, "only_filled", True) if only_filled: x = list(filter(lambda j: j["state"] == "filled", x)) x = OptionOrder.humanize_numbers(x) return x