Feature - repair 100x price errors #1110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Yahoo sometimes returns random prices 100x correct value. Only seen in London tickers, typically weekly data. Looks like Yahoo is mixing up currency units £ and pence. See issue #552 for detail.
Solution uses a
scipy
module to find these outliers. For Open/Close divide by 100, simple. For High/Low must recalculate because corrupted - 100 x low = new high. Recalculation fetches data at next resolution, e.g. if repairing weekly data fetch daily data for that week. Potential to trigger Yahoo spam detection, but normally only few outliers in a year of data so not expecting to trigger.Deliberately not adding scipy to dependencies, assuming most users won't use this feature.