If orders take too long to execute,then it means your code is still processing the strategy part. You maybe doing some heavy computations. How much time it takes to fire order once buy/sell signal is generated??
I don't know the logic you are using. How can i say if there is any logical error?? If there would be any syntax error, python would show error. Actually,if you are doing algo trading,first you should try 2-3 trades manually according to your strategy,and then check if the results from algo are accurate. This is beacuse sometimes,there would be no syntax error or anything which would directly show up,but there could be that some lines of your code might not be intended properly. Like,if you're using a while loop and if else statement inside it. Its possible that you might write the statement to be executed by the if else statement in the while loop indentation. The code will still work,no direct errors,but false signals can be generated. So, always check your indentations. And 10 sec is not the time to fire order,once buy/sell signal is generated. Its the time of your whole code to run. Orders take less than a second,they are as fast as placing from kite web or app unless there are some network issues. To check the time to fire order,just put a variable start_time=dt.now() just before the order_placing line. And right after the order_placing line,print(dt.now()-start_time). That's the real time to place order,it should be around 1 second or lesser.
And if 10 sec is too much for you,you can try upgrading your system,like processor,ram etc.
And if 10 sec is too much for you,you can try upgrading your system,like processor,ram etc.