diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-09-07 12:53:46 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-09-07 12:53:46 +0100 |
| commit | 7a3e24d69b27948891472f5cdd08833487939016 (patch) | |
| tree | 568ecac097f15cda7c5645a43dccbd77778961dc | |
| parent | Merge branch 'bugfix/aapl' into master (diff) | |
| download | TCPD-7a3e24d69b27948891472f5cdd08833487939016.tar.gz TCPD-7a3e24d69b27948891472f5cdd08833487939016.zip | |
Update comment in apple download script
The factor four was due to a 4-for-1 stock
split that occurred on 2020-08-28.
| -rw-r--r-- | datasets/apple/get_apple.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/datasets/apple/get_apple.py b/datasets/apple/get_apple.py index 12c173b..929671d 100644 --- a/datasets/apple/get_apple.py +++ b/datasets/apple/get_apple.py @@ -86,10 +86,12 @@ def write_csv(target_path=None): rounding=False, threads=False, ) - # Somewhere between 2020-08-26 and 2020-09-07 an API change - # happened (I guess) that changed these prices and the volume by a - # factor of 4. Long term this is a fragile solution, but for now - # this condition ensures that the correct file is generated. + # On 2020-08-28 Apple had a 4-for-1 stock split, and this changed + # the historical prices and volumes in the Yahoo API by a factor of + # 4. Since the original dataset was constructed before this time, + # we correct this change here by using a hard-coded closing price. + # This ensures that the resulting dataset has the same values as + # used in the TCPDBench paper. if 0.2131696 <= aapl["Close"][0] <= 0.2131697: aapl["Open"] = aapl["Open"] * 4 aapl["High"] = aapl["High"] * 4 |
