Closed karthickbala123 closed 3 years ago
push_tick_values_to_trd_portfolio(tick, ticks_token)
push_value_to_excel()
By looks, these seem to be time consuming operations. Try doing only in-memory operations in on_ticks()
and offload other functionalities to a separate thread.
Thank you for your reply @vijaykz can you send some exapmle code for memory operations bcoz am basic python user only. kindly help me
Refer to this example. This shows how to fetch & store ticks. Instead of database, you can simply maintain candles in list of list, for example.
Hi Vijaykz , In your example, you said you are sending ticks in celery taske queue where ticks are inserted into DB. But what if I want to do operation on latest ticks not on previous ticks. I want to compute on instant basis while getting ticks.
I do not have a need to save in DB. I create candlesticks in a list of lists like this:
ticks = [ [Date, O, H, L, C, V], [Date, O, H, L, C, V], .... [Date, O, H, L, C, V] ]
In order to perform operations on the latest bar, you can fetch it just by using ticks[-1]
I read previous discussions about this error but am not resolve this issue am also not using any computation inside on_ticks(). kindly help me