Login execute ho chuka hai ya nhi for niche di coding ki mutabik
-
Respected Sir/ma'am,
Sir/ma'am muje app ki ik help chahiye thi kafi din parshan hu
Problem - yeh aa rahi hai ke Jab order place hota hai execute nhi huya hota hai tab LIVE_FEED_JSON['3045']['ltp'] < 760 hone par short sell order lag jata hai
Main chatahu - Jab order place hota hai fir execute ho tab hi place order ki position exit ke liye sell order request lagaye
Execute ka logic add kare - jab place huya order execute na ho tab tak place order ki position exit karne ki liye sell order request na Lage
def monitor_and_place_orders():
order_1_placed = False
order_1_id = Nonewhile True: try: if not order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] > 764: trigger_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_1_id = place_order_1('3045', '1', trigger_price_1, order_price_1) if order_1_id: print('place_order_1', LIVE_FEED_JSON['3045']['ltp']) order_1_placed = True # Check for condition to place sell order if order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] < 760: sell_order_id = place_sell_order('3045', '1', order_1_id) if sell_order_id: print('Sell order placed for order ID:', order_1_id) break # Exit loop after placing sell order except Exception as e: print("Main loop error:", e) # Retry placing orders if an error occurs continue time.sleep(10)
-
@Mnagesh Sir, I wanted your help for a long time
Below is the coding related - sell part
Problem - I have that when the order place is pending but not executed then LIVE_FEED_JSON['3045']['ltp'] < 760 (less than 760) then a short sell order appears.
I want - when the order is placed and then executed, then only sell order request is made to exit the position of the place order. (If the order is only pending but not executed, then the sell order request should not appear)
Which function will be required to find out the status of an order through order status so that we can take an action after that.
def monitor_and_place_orders():
order_1_placed = False
order_1_id = Nonewhile True: try: if not order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] > 764: trigger_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_1_id = place_order_1('3045', '1', trigger_price_1, order_price_1) if order_1_id: print('place_order_1', LIVE_FEED_JSON['3045']['ltp']) order_1_placed = True # Check for condition to place sell order if order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] < 760: sell_order_id = place_sell_order('3045', '1', order_1_id) if sell_order_id: print('Sell order placed for order ID:', order_1_id) break # Exit loop after placing sell order
-
@Mnagesh Sir, I wanted your help for a long time
Below is the coding related - sell part
Problem - I have that when the order place is pending but not executed then LIVE_FEED_JSON['3045']['ltp'] < 760 (less than 760) then a short sell order appears.
I want - when the order is placed and then executed, then only sell order request is made to exit the position of the place order. (If the order is only pending but not executed, then the sell order request should not appear)
Which function will be required to find out the status of an order through order status so that we can take an action after that.
def monitor_and_place_orders():
order_1_placed = False
order_1_id = Nonewhile True: try: if not order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] > 764: trigger_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_1_id = place_order_1('3045', '1', trigger_price_1, order_price_1) if order_1_id: print('place_order_1', LIVE_FEED_JSON['3045']['ltp']) order_1_placed = True # Check for condition to place sell order if order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] < 760: sell_order_id = place_sell_order('3045', '1', order_1_id) if sell_order_id: print('Sell order placed for order ID:', order_1_id) break # Exit loop after placing sell order
-
@as5320029 Sir, I wanted your help for a long time
Below is the coding related - sell part
Problem - I have that when the order place is pending but not executed then LIVE_FEED_JSON['3045']['ltp'] < 760 (less than 760) then a short sell order appears.
I want - when the order is placed and then executed, then only sell order request is made to exit the position of the place order. (If the order is only pending but not executed, then the sell order request should not appear)
Which function will be required to find out the status of an order through order status so that we can take an action after that.
def monitor_and_place_orders():
order_1_placed = False
order_1_id = Nonewhile True: try: if not order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] > 764: trigger_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_1_id = place_order_1('3045', '1', trigger_price_1, order_price_1) if order_1_id: print('place_order_1', LIVE_FEED_JSON['3045']['ltp']) order_1_placed = True # Check for condition to place sell order if order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] < 760: sell_order_id = place_sell_order('3045', '1', order_1_id) if sell_order_id: print('Sell order placed for order ID:', order_1_id) break # Exit loop after placing sell order
-
Sir, I wanted your help for a long time
Below is the coding related - sell part
Problem - I have that when the order place is pending but not executed then LIVE_FEED_JSON['3045']['ltp'] < 760 (less than 760) then a short sell order appears.
I want - when the order is placed and then executed, then only sell order request is made to exit the position of the place order. (If the order is only pending but not executed, then the sell order request should not appear)
Which function will be required to find out the status of an order through order status so that we can take an action after that.
def monitor_and_place_orders():
order_1_placed = False
order_1_id = Nonewhile True: try: if not order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] > 764: trigger_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_1_id = place_order_1('3045', '1', trigger_price_1, order_price_1) if order_1_id: print('place_order_1', LIVE_FEED_JSON['3045']['ltp']) order_1_placed = True # Check for condition to place sell order if order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] < 760: sell_order_id = place_sell_order('3045', '1', order_1_id) if sell_order_id: print('Sell order placed for order ID:', order_1_id) break # Exit loop after placing sell order
-
@Mnagesh Sir, I wanted your help for a long time
Below is the coding related - sell part
Problem - I have that when the order place is pending but not executed then LIVE_FEED_JSON['3045']['ltp'] < 760 (less than 760) then a short sell order appears.
I want - when the order is placed and then executed, then only sell order request is made to exit the position of the place order. (If the order is only pending but not executed, then the sell order request should not appear)
Which function will be required to find out the status of an order through order status so that we can take an action after that.
def monitor_and_place_orders():
order_1_placed = False
order_1_id = Nonewhile True: try: if not order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] > 764: trigger_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_price_1 = LIVE_FEED_JSON['3045']['ltp'] order_1_id = place_order_1('3045', '1', trigger_price_1, order_price_1) if order_1_id: print('place_order_1', LIVE_FEED_JSON['3045']['ltp']) order_1_placed = True # Check for condition to place sell order if order_1_placed and '3045' in LIVE_FEED_JSON and LIVE_FEED_JSON['3045']['ltp'] < 760: sell_order_id = place_sell_order('3045', '1', order_1_id) if sell_order_id: print('Sell order placed for order ID:', order_1_id) break # Exit loop after placing sell order
-
@as5320029 write in English so that we may understand and help if possible