typically, its not a good idea to put so much code in the on_ticks function. best way is to just put ticks in a queue and then handle the data in main function. I have given a reference implementation for 1min and 15 min candle formation for multipl…
check last element in history. get status field in that. if sl has not hit then status will be "TRIGGER PENDING". if it got executed it will be "COMPLETE"
In on_ticks function the best way is to put the ticks in a queue and then process them in main function. I have modified the code of http://ezeetrading.in/Articles/Candles_formation_from_tick_data_zerodha.html
to include queues in python. I have gi…