pat42w / EF_Portfolio_Optimization

This project aims to test Portfolio Optimization methods on stock data in python.
MIT License
2 stars 0 forks source link

Negative Adj Close price from YFinance #8

Closed pat42w closed 3 years ago

pat42w commented 3 years ago

Negative prices in the price data this shouldn't be possible, seeing this as an issue in yfinance repo.

perhaps a drop of any columns with negatives would be an interim fix. I will investigate further. Until this is solved our modeling is pointless.

Another example is ITRN

import yfinance as yf
yf.download(['MSFT','ITRN'],'2006-1-1')['Adj Close']

image

Originally posted by @pat42w in https://github.com/ranaroussi/yfinance/issues/138#issuecomment-808890297

pat42w commented 3 years ago

Added function priceDB_validation() which checks for negative prices and attempts to re-pull the data(this works in some cases), it drops the columns if this doesn't solve the issue Add priceDB_validation() fix for Issue Negative Adj Close price from YFinance #8

Keep a eye on the issue on yfinance they may make say changes on their end.