(1) Stream live LTPs via Websocket. (2) Use a function#1 to insert these LTPs into a dataframe. (3) Use another function#2 to do certain calculations on these LTPs and fire orders based on that, check order status, cancel orders etc.
All the above 3 steps need to continuously run in a loop.
For (1), I am using your standard code structure and it is working fine. But apparently (and also based on your advice in other threads), it is not advisable to place other functions within the 'on-tick' function.
Could you advice where should (2) and (3) be placed in the overall code structure?