akapur / pyiqfeed

Python LIbrary for reading DTN's IQFeed
GNU General Public License v2.0
168 stars 108 forks source link

saving live data #57

Closed fs4590 closed 1 year ago

fs4590 commented 1 year ago

Hello, is there anyway you can add away to save the incoming live data for get_live_interval_bars please ? i did read the conn.py and i only were able to save it by using elif bar_type == 'H': in the _process_bars(self, fields: Sequence[str]) function. but it does not save into a file right away . it will only save after i stope the connection i am not experience developer , i just know basic python . been trying to do this since april 29 of this year .

akapur commented 1 year ago

pyiqfeed gets data. It doesn't save it. You will need to write code to save it yourself.

On Tue, Aug 23, 2022 at 3:40 AM fs4590 @.***> wrote:

Hello, is there anyway you can add away to save the incoming live data for get_live_interval_bars please ? i did read the conn.py and i only were able to save it by using elif bar_type == 'H': in the _process_bars(self, fields: Sequence[str]) function. but it does not save into a file right away . it will only save after i stope the connection i am not experience developer , i just know basic python . been trying to do this since april 29 of this year .

— Reply to this email directly, view it on GitHub https://github.com/akapur/pyiqfeed/issues/57, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGJAVBI2U3VXY2W6CAZPELV2R56PANCNFSM57KLG57A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

fs4590 commented 1 year ago

for those future readers who have similar issue .after akapur the creator if pyiqfeed explain to me that extra code needed to be added to save the data ,I was able to save streaming tick data by adding these lines after line 3210 in teh conn.py file, in teh elif bar_type =='c': statement ,right after the print(interval_data) add these lines. with open('live_data.csv','a+') as f: for line in interval_data: f.writelines("%s\n" % str(interval_data))

I hope this will help someone in teh future . akapur ,I thank you from teh bottoms of my heart image