Recommendation: Add adjusted data **besides** orginal data into the output
mvrahden opened this issue · 1 comments
How it is currently being done:
The output will either render the original close data point OR the adjusted close data point.
With this practice, you're reducing information irrevocably and reducing the meaningfulness of the data you're gathering.
EDIT: After reviewing the code further in detail, I see that the adjusted close and original close are swapped. When adjustQuote
is true
, original data is being rendered besides the adjusted close, or adjusted data is being rendered besides original close. Bug or Feature?
How it would be advised:
The output should compile (if adjusted data is given in from the source) a list with the original data columns AND adjusted data columns (see e.g. https://www.quandl.com/databases/WIKIP/data). Adjusted open, high, low prices can be rendered by using the ratio between original close and adjusted close, multiplied by the each original data column.
So given a data-source where you could gain maximum information as summary per trading day (incl. ex-dividend and split), the output would look like this:
- date / timestamp
- open
- high
- low
- close
- volume
- ex-dividend
- split
- adj-open
- adj-high
- adj-low
- adj-close
- adj-volume
If you want to stick to your output structure, I'd recommend to either output bare unadjusted data or pure adjusted data.
Otherwise you get a distorted output like the following (e.g. AAPL from yahoo):
datetime,open,high,low,close,volume
2015-04-27 00:00,132.31,133.13,131.15,122.73,96954200.00
2015-04-28 00:00,134.46,134.54,129.57,120.80,118924000.00
The spread between OHL data to AdjClose is almost 10% in this case. This distorts OHLC-based analytics.
I don't think it's realistic at this time to change to output format and the adjustment only applies to the Yahoo data source.
If you look at the code, I used to adjust the data in the way you suggest (now commented out). I believe I changed it because Yahoo changed the format of the data returned from their unofficial api. Perhaps they changed it again.
Frankly, the Yahoo source has been very problematic and unreliable and I no longer use it personally. I am not sure it's worth the effort to keep chasing all their api changes.
Thanks for your input. Pull requests welcome if you would like to take this on.