forked from dineshh-choudhary/alice_blue_algo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CheckOrderExecution
27 lines (22 loc) · 965 Bytes
/
CheckOrderExecution
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class AliceHelper:
# open complete rejected
def check_order_execution(self, order_info):
all_order_history = order_info
order_history = all_order_history["data"][0]
res = {
"status": order_history["order_status"],
"order_history": order_history,
"all_order_history" : all_order_history,
"is_complete": False,
"is_rejected": False,
"is_open": False
}
# if (all_order_history["status"] == "success"):
if order_history["order_status"] in ["open", "open pending", "validation pending",
"put order req received", "trigger pending"]:
res["is_open"] = True
elif (order_history["order_status"] in ["complete"]):
res["is_complete"] = True
elif (order_history["order_status"] in ["rejected"]):
res["is_rejected"] = True
return res