If we have to use algo with the data from web socket we should analyse data. def on_tick(tick, ws): print(tick) this only prints the trick data and I have modified the above to declaring a list and list.append(tick) but nothing works. I saw that someone using db_method but I think module obsolete with python 3 and above.
Ticker will be on different thread, so it won't work. I would suggest you to directly write to database.