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

Exception in LiveAuxiliaryDataSynchronizingEnumerator #20

Open
3 of 4 tasks
Amol-Gupta opened this issue Jan 25, 2023 · 1 comment
Open
3 of 4 tasks

Exception in LiveAuxiliaryDataSynchronizingEnumerator #20

Amol-Gupta opened this issue Jan 25, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Amol-Gupta
Copy link

Amol-Gupta commented Jan 25, 2023

Actual Behavior

I am facing an exception on LiveAuxiliaryDataSynchronizingEnumerator.cs

2023-01-25 11:10:00 Runtime Error: Instant out of range for DateTime in LiveAuxiliaryDataSynchronizingEnumerator.cs:line 179
2023-01-25 11:10:00 Runtime Error: Instant out of range for DateTime in LiveAuxiliaryDataSynchronizingEnumerator.cs:line 179: StackTrace: System.Exception: Instant out of range for DateTime in LiveAuxiliaryDataSynchronizingEnumerator.cs:line 179
 ---> System.InvalidOperationException: Instant out of range for DateTime
   at NodaTime.Instant.ToDateTimeUtc()
   at NodaTime.ZonedDateTime.ToDateTimeUtc()
   at QuantConnect.Lean.Engine.DataFeeds.Enumerators.LiveAuxiliaryDataSynchronizingEnumerator.DataPointEmitted(DateTime frontierUtc) in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\Enumerators\LiveAuxiliaryDataSynchronizingEnumerator.cs:line 179
   at QuantConnect.Lean.Engine.DataFeeds.Enumerators.LiveAuxiliaryDataSynchronizingEnumerator.MoveNext() in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\Enumerators\LiveAuxiliaryDataSynchronizingEnumerator.cs:line 76
   at QuantConnect.Lean.Engine.DataFeeds.Enumerators.FillForwardEnumerator.MoveNext() in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\Enumerators\FillForwardEnumerator.cs:line 138
   at QuantConnect.Lean.Engine.DataFeeds.Enumerators.FrontierAwareEnumerator.MoveNext() in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\Enumerators\FrontierAwareEnumerator.cs:line 83
   at QuantConnect.Lean.Engine.DataFeeds.Enumerators.SubscriptionFilterEnumerator.MoveNext() in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\Enumerators\SubscriptionFilterEnumerator.cs:line 123
   at QuantConnect.Lean.Engine.DataFeeds.Enumerators.SubscriptionDataEnumerator.MoveNext() in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\Enumerators\SubscriptionDataEnumerator.cs:line 71
   at QuantConnect.Lean.Engine.DataFeeds.Subscription.MoveNext() in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\Subscription.cs:line 206
   at QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer.Sync(IEnumerable`1 subscriptions, CancellationToken cancellationToken)+MoveNext() in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\SubscriptionSynchronizer.cs:line 116
   at QuantConnect.Lean.Engine.DataFeeds.LiveSynchronizer.StreamData(CancellationToken cancellationToken)+MoveNext() in C:\Users\amolg\source\repos\LeanSetups\Setup_2\Lean\Engine\DataFeeds\LiveSynchronizer.cs:line 118

Expected Behavior

I have tried debugging the LiveAuxiliaryDataSynchronizingEnumerator.cs at line 179. It is trying to convert the EndTime to UTC. EndTime was already matching with the UTC. I am in India which is GMT+5:30 (TimeZones.Kolkata). I am not sure what the actual behavior but the aforementioned behavior is incorrect.
Also, all subscribed symbols are unsubscribed on the first tick.

Potential Solution

Reproducing the Problem

Checkout following 2 repos in empty
https://github.com/Amol-Gupta/Lean.git
https://github.com/Amol-Gupta/Lean.Brokerages.Samco.git

checkout temp1 branch On both repo. Fill in credentials for samco. Build, Run. that will help in reporoducing the isssue

System Information

Windows 11. Visual studio.

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
@Martin-Molinero Martin-Molinero added the bug Something isn't working label Feb 9, 2023
@Martin-Molinero
Copy link
Member

Hi @Amol-Gupta!
Thanks for the report. Lean expects data to be emitted in exchange time zone as per the market-hours-database specifications.

It is trying to convert the EndTime to UTC. EndTime was already matching with the UTC.

That sounds like the bug, ref https://github.com/QuantConnect/Lean.Brokerages.Samco/blob/master/QuantConnect.SamcoBrokerage/SamcoBrokerage.cs#L838

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants