There are many corporate actions that will affect the stock price, like dividend, stock split and rights.
Given a large series of historical price data, how do we adjust the data to filter out the effect of the corporate action?
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It only takes a minute to sign up.
Sign up to join this communityQ: How do strategies deal with corporate actions?
A: Very carefully.
Jokes aside, it is not trivial, and the answer depends on what you want to do with the data. Yahoo provides adjusted stock prices/returns for splits/mergers/dividend, as explained by Shane. The resulting time series is not very useful for predictive and risk management purposes. Commercial providers (or their resellers) do not follow this approach. They develop an internal and unique ID for every asset (Barra ID, Axioma Db, Thomson Reuters has its own etc.) that is mapped to the ticker/cusip/sedol at any given date. Prices are not merged and dividends are reported separately. Why is that? Because if you want to actually predict asset returns, you're better off with the pristine time series. For example, if you want to develop a model to predict returns of HPQ, you are better off looking at HP time series pre-merger with Compaq, and HPQ afterwards. By combining their return, you would corrupt the value of predictive variables like company size, EPS. etc. One more complication: from the announcement of the merger of CPQ and HP, their return was effectively coupled. How you go about modeling this correlation of their idiosyncratic returns is highly subjective, but it shouldn't be ignored.
Finally, one more point: when building a prediction model of stock returns based on daily or monthly data, the dividend should be ignored, since the value of the dividend is already priced in the asset prices and returns.
I am just skimming the surface of the issue. But the take-away messages are:
Daily returns from public sources do not backfill for delisted assets, so you have a survivorship bias. If you are using those, I recommend having a small universe, a short time interval (2-3 years), and using unadjusted returns.
You can take a corporate action and look at a price before/after the event. In general, this simply means applying a series of multiplicative or additive factors.
As an example, with a $2:1$ stock split, the price following the event will be $1/2$ what it was prior to the split. If you want to see the prices as they were before then you need to multiply all future prices by 2. On the other hand, if you want to see historical prices so that they are continuous with the new price level, you would need to divide them by 2.
Stock dividends are also multiplicative, while cash dividends are additive (meaning that you would add or subtract the values).
Many good price sources can give you prices adjusted or unadjusted.
It appears like you're asking for steps on how to process large datasets. The best solution for handling/processing/filtering these things is a relational database. I use MySQL or Oracle most of the time.
Here is something that I usually do:
:D