main.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:CTPrivAPI 作者: doubleelforbes 项目源码 文件源码
def cancelalltrades():
    global privapi
    global orders
    if len(orders) > 0:
        warning = messagebox.askokcancel("############ WARNING!! ############",
                                         "You have requested a cancel on ALL trades!")
        if warning:
            ttype = "All"
            response = privapi.canceltrade(ttype)
            if isinstance(response, str):
                debugout(response)
            else:
                orderstr = "All Trade Cancel Submitted! "
                if len(response) > 0:
                    orderstr = orderstr + "Cancelled Order ID's: "
                    for corder in response:
                        orderstr = orderstr + str(corder) + ", "
                debugout(orderstr)
            getorders()
        else:
            debugout("User Cancelled All Trade Cancellation after warning.")
    else:
        debugout("ERROR! - No Orders Found! Please try again.")
        getorders()


# Just a way to use 2 button handlers to start the trade with a binary choice
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号