I have come across a handful of tickers with negative values in the adj_close historical data. This is due to a dividend larger than the close price. See for example, TEPCF: prior to 2024-03-28, the adj_close price is $-3.16.
Adjusting the open, high, and low price to match is straightforward, just [o,h,l]*(adj_close/close). For typical (non-negative) adj_close prices, adjusting the volume is performed with an inverse operation, v/(adj_close/close). This equation falls apart when the adj_close goes negative, however, since you can’t have negative volume (you can’t really have negative price either, but that feels a bit easier to understand).
What is the best way to handle this corner case? I have come across 10-20 stocks so far that have negative adj_close values.
Looking through the docs for the old QUANDL database, it looks like they handled adj_volume by only adjusting for splits, ignoring dividends and spinoffs (the OHLC prices included all three). Financial, Economic and Alternative Data | Nasdaq Data Link
Maybe that is the right way to handle it, although it does mean a bit more number crunching to get right.
Hello. Negative adjusted prices come primarily from tickers with dividends in a different currency that that of the ticker itself (in case of TEPCF, however, I don’t see an issue, suppose it’s been automatically corrected by now).
In any case, the volume that is provided in the API is already adjusted - to splits, that is, if there were any. Volume is not adjusted to dividend adjustments. Reverse adjusting the volume to splits is simple - you can use the split data from the Splits API to get the reversed, non-adjusted volume of the day.
I think there are a handful of tickers with foreign currency dividends that are not having the currency properly set, so they are showing up as USD. Here are a few more examples I saw possible issues with (some may have been corrected already): GERS, LTGHF, PRAC, CIERF, IDKOF, SGIPF.
This is good to know though, I didn’t realize that was happening. So if I want to display a fully adjusted OHLC I only need to adjust the open, high, and low prices and I can leave volume alone across the board?
We have reviewed the tickers you provided, and the data has been updated. You are correct about the price adjustments; you only need to adjust the OHLC values, as the volumes have already been adjusted for splits. Additionally, you can use the Technical API to obtain data that has been adjusted for splits.
We recommend contacting our support team for technical issues, as they can provide assistance within minutes.