Repeat orders getting triggered

Hello Team,

The program places more than one order at the same time though my code is written to place a single order. I am using the the order id generated in the following logic, which gives an issue when multiple orders are being triggered. Could someone help me as to how to go about it and avoid duplicate orders.

Any help is appreciated.

Thanks,

Naveen.

Hi @naveen.ey3pudks

It is not possible until and unless you place from your end.
Please show me your code. Or it can be reason while checking condition you are not putting break so for same condition it is placing continuously.
Make sure your code is correct.

Thanks for your quick reply Pankaj,

Sure will share the code I am using. As per my understanding, only the order placement statement is getting repeated. The next statement to update the number of trades is being executed just once.

Below is the code snippet and the screenshot of the orders screen where the repeated orders were triggered:

if (cc_nifty[‘SUPERTd_14_3.0’] == 1 and cc_nifty[‘rsi’] >=60 and traded_ce == None and

traded_scripts_ce == and (current_time > start_time) and (current_time < stop_time) and

no_of_ce_trades_executed< Max_no_of_trades_to_be_executed):

option_symbol = go.get_option_symbol(cc_nifty[‘close’],“CE”,expiry)

option_symbol = str(option_symbol.iloc[0]).lstrip("1234567890 ")

print("\nSelected option is : ",option_symbol,‘\n’)

data = { “symbol”:option_symbol,“qty”:quantity,“type”:2,“side”:1,“productType”:“INTRADAY”,“limitPrice”:0,“stopPrice”:0,“validity”:“DAY”,“disclosedQty”:0,“offlineOrder”:“False”,}

print(fyers.place_order(data))

order_id = fyers.place_order(data)[‘id’]

no_of_ce_trades_executed = no_of_ce_trades_executed +1

traded_ce = “yes”

traded_scripts_ce.append(option_symbol)

print ("order id is : ", order_id)

Please let me know if you see any discrepancy in the code,

Thanks in advance,

Naveen

and where is IF condition

is it in Loop ?

Yes, but I think I found it, It was my mistake. As I am new to Fyers, did not understand the sample codes correctly. Was using the order placement syntax multiple times for getting the status details of the same, which caused the order to trigger multiple times. Apologize for the confusion and thanks for the quick support @Z4PBvkQGyF.

Welcome @naveen.ey3pudks
Good to know you got it.