Recalculate Open, High, Low, Close values based on Adjusted Close.

Common historical data file format: Date, Open, High, Low, Close, Volume, Adj. Close

If used in data analysis, open, high, low, close values should be recalculated based on adjusted close value that takes into account stock splits and dividents. Close should be just replaced with the adjusted close whereas open, high and low should be recalculated based on close/adjusted close ratio.

An example of recalculated open: Open = Open * Adj Close/ Close



Query used to recalculate open, high, low and close:
update qqq 
set
[close] = [adj close],
[open] = cast([open]*[adj close]/[close] as decimal(10,2)),
[high] = cast( [high]*[adj close]/[close] as decimal(10,2)),
[low] = cast( [low]*[adj close]/[close] as decimal(10,2))

theCrunchR | © 2011