Update LinearWeightedMovingAverage.cs
Fix off by one indexing error in denominator, and calculation error in numerator.
Description
Related Issue
Motivation and Context
Requires Documentation Change
How Has This Been Tested?
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.
- [ ] All new and existing tests passed.
- [ ] My branch follows the naming convention
bug-<issue#>-<description>orfeature-<issue#>-<description>
Hey @mr-september! Welcome to Lean Please share some information about the issue, error/how to reproduce? We should add some unit test reproducing the issue so we can assert it's nature and how to and if it's been fixed 👍
Hey @mr-september! Welcome to Lean Please share some information about the issue, error/how to reproduce? We should add some unit test reproducing the issue so we can assert it's nature and how to and if it's been fixed 👍
Hi, my apologies, I am not an experienced developer, especially not with C#. I have merely noticed inconsistent behaviour while porting strategies from another platform to QuantConnect, and after some attempts to investigate, I believe this may be the root of the issue.
It is not a technical error, but a mathematical/logical one. It may be best to have someone more experienced review this indicator's implementation.
Thank you @mr-september, we've revised the current implementation and believe it's correct, we've added more tests comparing the expected values with 3rd party.