-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Price repair
The new argument repair=True
in history()
and download()
will attempt to fix a variety of price errors caused by Yahoo. Only US market data appears perfect, I guess Yahoo doesn't care much about rest of world?
The returned table will have a new column Repaired?
that specifies if row was repaired.
If dividend in data but preceding Adj Close
= Close
, then manually apply dividend-adjustment to Adj Close
.
Note: Repaired?
is NOT set to True
because fix only changes Adj Close
8TRA.DE
If stock split in data but preceding price data is not adjusted, then manually apply stock split.
Requires date range include 1 day after stock split, for calibration. Sometimes Yahoo fails to adjust prices on stock split day.
MOB.ST
If price data is clearly missing or corrupt, then reconstructed using smaller interval e.g. 1h
to fix 1d
data.
1COV.DE
missing row
1COV.DE
missing Volume
Sometimes Yahoo mixes up currencies e.g. $/cents or £/pence. So some prices are 100x wrong.
Sometimes they are spread randomly through data - these detected with scipy
module.
Other times they are in a block, because Yahoo decided one day to permanently switch currency.
AET.L
Spam minimised by grouping fetches. Tries to be aware of data limits e.g. 1h
cannot be fetched beyond 2 years.
If Yahoo eventually does fix the bad data that required reconstruction, you will see it's slightly different to reconstructed prices and volume often significantly different. Best I can do, and beats missing data.