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
评论列表
文章目录