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

RandomDataGenerator: Generation of CFD data not working #5030

Closed
4 tasks done
typexy opened this issue Dec 13, 2020 · 1 comment
Closed
4 tasks done

RandomDataGenerator: Generation of CFD data not working #5030

typexy opened this issue Dec 13, 2020 · 1 comment
Labels
good first issue If you're looking to get started as a LEAN contributor, check out these starter issues!

Comments

@typexy
Copy link

typexy commented Dec 13, 2020

Expected Behavior

Expected the creation of random data for CFDs.

Actual Behavior

Unhandled Exception is thrown - maximum date time must be less than or equal to the minimum. Details below:

Unhandled Exception: System.ArgumentException: The maximum date time must be less than or equal to the minimum date time specified at QuantConnect.ToolBox.RandomDataGenerator.RandomValueGenerator.NextDate (System.DateTime minDateTime, System.DateTime maxDateTime, System.Nullable1[T] dayOfWeek) [0x0001c] in <2c66f80613ff41adb34692107bcbb7d4>:0
at QuantConnect.ToolBox.RandomDataGenerator.RandomDataGeneratorProgram.GenerateRandomData (QuantConnect.ToolBox.RandomDataGenerator.RandomDataGeneratorSettings settings, QuantConnect.ToolBox.RandomDataGenerator.ConsoleLeveledOutput output) [0x00122] in <2c66f80613ff41adb34692107bcbb7d4>:0
at QuantConnect.ToolBox.RandomDataGenerator.RandomDataGeneratorProgram.RandomDataGenerator (System.String startDateString, System.String endDateString, System.String symbolCountString, System.String market, System.String securityTypeString, System.String resolutionString, System.String dataDensityString, System.String includeCoarseString, System.String quoteTradeRatioString, System.String randomSeed, System.String hasIpoPercentageString, System.String hasRenamePercentageString, System.String hasSplitsPercentageString, System.String hasDividendsPercentageString, System.String dividendEveryQuarterPercentageString) [0x00028] in <2c66f80613ff41adb34692107bcbb7d4>:0
at QuantConnect.ToolBox.Program.Main (System.String[] args) [0x010d3] in <2c66f80613ff41adb34692107bcbb7d4>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: The maximum date time must be less than or equal to the minimum date time specified
at QuantConnect.ToolBox.RandomDataGenerator.RandomValueGenerator.NextDate (System.DateTime minDateTime, System.DateTime maxDateTime, System.Nullable1[T] dayOfWeek) [0x0001c] in <2c66f80613ff41adb34692107bcbb7d4>:0 at QuantConnect.ToolBox.RandomDataGenerator.RandomDataGeneratorProgram.GenerateRandomData (QuantConnect.ToolBox.RandomDataGenerator.RandomDataGeneratorSettings settings, QuantConnect.ToolBox.RandomDataGenerator.ConsoleLeveledOutput output) [0x00122] in <2c66f80613ff41adb34692107bcbb7d4>:0 at QuantConnect.ToolBox.RandomDataGenerator.RandomDataGeneratorProgram.RandomDataGenerator (System.String startDateString, System.String endDateString, System.String symbolCountString, System.String market, System.String securityTypeString, System.String resolutionString, System.String dataDensityString, System.String includeCoarseString, System.String quoteTradeRatioString, System.String randomSeed, System.String hasIpoPercentageString, System.String hasRenamePercentageString, System.String hasSplitsPercentageString, System.String hasDividendsPercentageString, System.String dividendEveryQuarterPercentageString) [0x00028] in <2c66f80613ff41adb34692107bcbb7d4>:0 at QuantConnect.ToolBox.Program.Main (System.String[] args) [0x010d3] in <2c66f80613ff41adb34692107bcbb7d4>:0

Reproducing the Problem

mono QuantConnect.ToolBox.exe --app=rdg --security-type=cfd --start=20200101 --end=20200201 --symbol-count=1 --market=oanda

System Information

Ubuntu 20.04.1 LTS, everything installed as stated in the docs.

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
@typexy typexy changed the title RandomDataGenerator: Generate CFD data not working RandomDataGenerator: Generation of CFD data not working Dec 13, 2020
@jaredbroad jaredbroad added good first issue If you're looking to get started as a LEAN contributor, check out these starter issues! up for grabs labels Dec 25, 2020
Martin-Molinero added a commit that referenced this issue Jan 8, 2021
* Update RandomDataGeneratorProgram.cs

Replaced AddMonths(6) with a Datetime value half way between settings.Start and settings.End.

* Update RandomDataGeneratorProgram.cs

* Update to bug-5030-CFDdatanotoworking

* Added midpoint unit test

* Minor test assert improvement

Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
@Martin-Molinero
Copy link
Member

Hey!
This is working in current Lean master, must of been fixed in recent random data generator refactoring to support options. Will close the issue for now. Please re open if still having issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue If you're looking to get started as a LEAN contributor, check out these starter issues!
Projects
None yet
Development

No branches or pull requests

3 participants