It looks like you're new here. If you want to get involved, click one of these buttons!
def function_1(parent_order_id, price):
try:
kite.modify_order(
variety="iceberg",
order_id=parent_order_id,
price=price,
trigger_price=price
)
return True
except Exception as e:
print(f"Error modifying SL: {e}")
return False
def function_2(parent_order_id, price):
try:
orders = kite.orders()
active_states = {"OPEN", "TRIGGER PENDING"}
for o in orders:
if o.get("parent_order_id") == parent_order_id and o["status"] in active_states:
kite.modify_order(
variety=o["variety"],
order_id=o["order_id"],
price=price,
trigger_price=price
)
return True
except Exception as e:
print_log(f"Error modifying SL: {e}")
return False