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