I am not placing any orders in the on_ticks function
No, you are calling the method that uses historical data APIs and places order(strategy_check) inside on_ticks thread only. @sharwan We don't help in coding your strategy, we can help you in understanding the flow/logic. The coding part, you will have to do this at your end.
I need the LTP from the on_ticks function to place the stop-loss order. that is the reason I am taking last_price and proceeding to place orders. I don't need the tick data for the Buy order, but for checking stop loss continuously, I need the tick data. If I don't call any function in the on_ticks function, then how can I make use of the live ticks for placing the stop loss or target order.
You shouldn't place any order inside on_tick thread. Use multi-thread and place an order on another thread.
Maybe this thread can help.
@sujith @rakeshr
strategy_check
) inside on_ticks thread only.@sharwan
We don't help in coding your strategy, we can help you in understanding the flow/logic. The coding part, you will have to do this at your end.
If I don't call any function in the on_ticks function, then how can I make use of the live ticks for placing the stop loss or target order.