Use a CSV File as live feed
Santiago Barreira last edited by
I have read other topics regarding the live feeds but could not find any clue in how to use a CSV local file (which is being updated by another program) as a live feed.
I am trying the following feed definition:
class dataFeed(feeds.GenericCSVData): params = ( ('dtformat', '%Y-%m-%d %H:%M:%S'), ('datetime', 0), ('open', 2), ('high', 3), ('low', 4), ('close', 5), ('volume', 6), ('openinterest', -1) ) def islive(self): return True _qcheck = 10
Is the qcheck param suppose to tell crebro to wait for 10 seconds for new live data from the feed?
Anyway, my program ends as soon as it starts without giving time to the file to generete new lines.
Thanks for any help!
One could foresee a live feed from files, but that would have to take into account monitoring changes in the file properties (size, modification time).
Adding those methods won't magically transform a line reader which quits on reading the last line into code that monitors the file on a continuous basis.