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

Bug #5030 Generation of CFD data not working #5112

Merged
merged 5 commits into from Jan 8, 2021
Merged

Bug #5030 Generation of CFD data not working #5112

merged 5 commits into from Jan 8, 2021

Conversation

jovuribe
Copy link
Contributor

@jovuribe jovuribe commented Jan 4, 2021

Description

Addressing issue #5030 with random generation of CFD data not working

In RandomDataGeneratorProgram.cs, var delistDate will produce a minValue greater than the maxValue at settings.Start.AddMonths(6) if the time difference between settings.Start and settings.End is less than 6 months. I addressed this issue by replacing this operation with a Datetime object that is halfway between settings.Start and settings.End.

Related Issue

https://github.com/QuantConnect/Lean/issues/5030

Motivation and Context

I spent some time working with Toolbox during the summer and this issue was brought to my attention. It solves an issue with random data generation for CFD data.

Requires Documentation Change

N/A

How Has This Been Tested?

I tested this on my private fork.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • [] I have added tests to cover my changes.
  • Toolbox tests already exist. Ie. QuantConnect.Tests.Toolbox.RandomValueGenerator. Additionally, I attempted to reproduce the original bug on my private fork and no bugs occurred.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

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

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the test, almost there

Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Martin-Molinero Martin-Molinero merged commit b85a32a into QuantConnect:master Jan 8, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants