Also, can you let me know the limitations of API, i.e. on the number of orders that can be placed per tick, and other limitations? Is there any documentation present regarding the limits.
I didn't get error 1006 when I just print the tick on on_tick function, but I get the error I if start placing orders on on_tick function after some 10 minutes.
I didn't get error 1006 when I just print the tick on on_tick function, but I get the error I if start placing orders on on_tick function after some 10 minutes.
You are blocking the main tick thread.You need to pass on the tick value to another thread from on_tick handler for any calculation, so main thread is not blocked.
f(): some function to place order
fun on_tick(tick):
f()
print(tick)
this caused the error, but if i comment f(), and only print the tick in on_tick then no 1006 error came
kws.connect(threaded=True)
and then pass on the value.You can check an example of mult-threading here.