New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot change the time to daily #4

Open
pashute opened this Issue Nov 9, 2017 · 3 comments

Comments

Projects
None yet
1 participant
@pashute

pashute commented Nov 9, 2017

Doesn't matter what I put in bars in seconds

It is saved in historic data as str(self.timeframe) and in the message: as '{0}' (enclosed in single quote).

I changed it to integer and it fails.

If I keep it as string, it gives me 1 minute info (60) whether I put in 86400 or 1440.
If I put 1, it fails. If I put 'd' it gives me 1 minute info.

Where is the documentation for the "HIT" message?

(I'm using the modified version for version 3.6 with the two utf-8 fixes... could that be affecting the message) .

@pashute

This comment has been minimized.

Show comment
Hide comment
@pashute

pashute Nov 10, 2017

I asked also on the DTN forum

Perhaps its a sockets issue.

I erased the temporary files from their location before retrying.

I'll try sending it without the single quotes again. but leave the number as str(self.timestamp) so the %s can work correctly, and will debug. Tell you the results here.

pashute commented Nov 10, 2017

I asked also on the DTN forum

Perhaps its a sockets issue.

I erased the temporary files from their location before retrying.

I'll try sending it without the single quotes again. but leave the number as str(self.timestamp) so the %s can work correctly, and will debug. Tell you the results here.

@pashute

This comment has been minimized.

Show comment
Hide comment
@pashute

pashute Nov 10, 2017

Solved by a mix of codefix here, and overcoming a bug (or missing docs) in IQFeed DTN socket api.

I use direct timeframe without str() and without surrounding quotemark and works with hourly (3600) but not daily (86400). But if I pass: 36000 (10 hours) I get daily at 16:00 !

So it was two bugs. One here (or two if you count the sockets) and one which seems a bug of IQFeed socket DTN API. Let me join the project and I'll put up the fixed code with remarks.

I use:

buffer += data.decode("utf-8")

message = "HIT,{0},{1},{2},{3},,093000,160000,1\n".format(symbol, self.timeFrame, self.startDate, self.endDate)

sock.sendall(message.encode('utf-8'))  # see issue 2 on github

sock.shutdown(socket.SHUT_RDWR)  # see issue 1 on github
sock.close()  # added method parenthesis (as part of issue 1 fix)

pashute commented Nov 10, 2017

Solved by a mix of codefix here, and overcoming a bug (or missing docs) in IQFeed DTN socket api.

I use direct timeframe without str() and without surrounding quotemark and works with hourly (3600) but not daily (86400). But if I pass: 36000 (10 hours) I get daily at 16:00 !

So it was two bugs. One here (or two if you count the sockets) and one which seems a bug of IQFeed socket DTN API. Let me join the project and I'll put up the fixed code with remarks.

I use:

buffer += data.decode("utf-8")

message = "HIT,{0},{1},{2},{3},,093000,160000,1\n".format(symbol, self.timeFrame, self.startDate, self.endDate)

sock.sendall(message.encode('utf-8'))  # see issue 2 on github

sock.shutdown(socket.SHUT_RDWR)  # see issue 1 on github
sock.close()  # added method parenthesis (as part of issue 1 fix)
@pashute

This comment has been minimized.

Show comment
Hide comment
@pashute

pashute Nov 12, 2017

Looking at anpur's iqfeed, there is HTT for periodic data (daily feed) instead of HIT.

So I will try it and add it in, in a pull request.

pashute commented Nov 12, 2017

Looking at anpur's iqfeed, there is HTT for periodic data (daily feed) instead of HIT.

So I will try it and add it in, in a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment