getting tick into DataFrame instead of printing it.

qtrader
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.
Tagged:
  • sujith
    Hi,
    Ticker will be on different thread, so it won't work. I would suggest you to directly write to database.
  • qtrader
    @sujith : So you suggest to write to the sql database at the on_tick method?
  • sujith
    Yes. I would suggest doing it.
  • naz
    @qtrader might be useful to append the tick to pandas DataFrame object and use it from there. You will have to create that as global variable though.
Sign In or Register to comment.