Skip to content
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

historical data is one day old #12

Open
ghost opened this issue May 30, 2014 · 1 comment
Open

historical data is one day old #12

ghost opened this issue May 30, 2014 · 1 comment

Comments

@ghost
Copy link

ghost commented May 30, 2014

When i pull Historical data after 8 am EST, i can get till EOD yesterday. If i pull it before 8 AM EST, i get data ie 2 days old. Can anyone duplicate it.

@ghost
Copy link
Author

ghost commented Jun 1, 2014

Actually IB is sending the data in localtime and not in GMT. The code has a bug as it assumes GMT
fixed my copy locally but did not know how to checkin and so cut and pasted my patch here, Hopfully someone can update the repository,
#region Process Message

    /// <summary>Overridden in subclass.</summary>
    private bool ProcessMsg(IncomingMessage msgId)

.......................

case IncomingMessage.HistoricalData:

if(longDate < 30000000)
// timeStamp = new DateTime(Int32.Parse(date.Substring(0, 4)), Int32.Parse(date.Substring(4, 2)), Int32.Parse(date.Substring(6, 2)), 0, 0, 0, DateTimeKind.Utc).ToLocalTime();
timeStamp = new DateTime(Int32.Parse(date.Substring(0, 4)), Int32.Parse(date.Substring(4, 2)), Int32.Parse(date.Substring(6, 2)), 0, 0, 0, DateTimeKind.Local).ToLocalTime();
else
timeStamp = new DateTime(1970,1,1,0,0,0,DateTimeKind.Utc).AddSeconds(longDate).ToLocalTime();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants