OpenBB-finance / OpenBB

Investment Research for Everyone, Everywhere.
https://openbb.co
Other
34.06k stars 3.12k forks source link

[FR]need backward adjusted close data #6917

Open markqiu opened 3 weeks ago

markqiu commented 3 weeks ago

What's the problem of not having this feature?

  1. Forward Adjustment (Forward Adjusted Data): Each dividend payout or bonus share issuance leads to an adjustment in historical price data. If forward adjusted data is used, moving average indicators (such as Moving Average lines) need to be recalculated every time a new dividend occurs.
  2. Backward Adjustment (Backward Adjusted Data): Backward adjusted prices accumulate all the effects of dividends onto the latest price, so historical prices do not change due to dividend adjustments. Using backward adjusted data for backtesting is highly efficient, simple, and widely used.

Describe the solution you would like found a provider which has backward adjusted data, although I don't know which one.

Describe alternatives you've considered no

Additional information no

deeleeramone commented 3 weeks ago

Hi there,

Data providers return data and they may or may not disclose the adjustment factor. There can be 3 types of adjustment factors, if supported by the provider, ["splits_only", "splits_and_dividends", "unadjusted"].

Some may provide the information required to back out any adjustments they make, but sometimes not. Worst case scenario is their prices are dividend and split adjusted, but they do not provide adequate information to back out adjustments. Even more fun is when dividend payments values are returned as unadjusted, but the historical prices are split-adjusted.

This is a large factor in the overall quality of a data source, and something to consider when requesting historical prices.

historical prices do not change due to dividend adjustments.

"splits_only" is what this is. This will always be the default, unless the provider does not actually have that as an option.

Each dividend payout or bonus share issuance leads to an adjustment in historical price data.

"splits_and_dividends" is what this is, people will use this as a base for total returns, but it is not the correct way to arrive at that number. Prices under this adjustment never happened and using these adjustments when accurate prices are required will lead to questionable results.

If you are actually looking for adjustment factors that result in a proper total return number, that will need to be constructed by the user post-request because there are too many X-factors to apply with unknown symbol/input/source material. This is why people use dividend-adjusted prices, at the trade off of not being a proper metric.