Skip to content

$CHANGE is calculated based on close instead of adj_close in the YahooCollector #1563

@xu-li

Description

@xu-li

🐛 Bug Description

$CHANGE is calculated based on close instead of adj_close in the YahooCollector

To Reproduce

Steps to reproduce the behavior:

  1. Download the data from Yahoo Finance. Using 301303.SZ as an example only because the dataset is small.
  2. Notice the following data in the downloaded csv (removed unnecessary columns for demonstration purpose)
    Date,Close,Adj Close 2023-06-05,23.120001,22.893938 2023-06-06,22.500000,22.280001 2023-06-07,22.240000,22.240000
  3. Normalize the downloaded csv file using data_collector.yahoo.collector.YahooNormalizeCN1d.
  4. Check the normalized data. The change on 2023-06-06 is -0.026816608996539815 which is correct and the change on 2023-06-07 is -0.011555555555555652 which is wrong.

Expected Behavior

The change on 2023-06-07 should be 22.240000/22.280001 - 1. = -0.0017953769391662044.

Screenshot

Environment

Linux x86_64
Python version: 3.8.16
Qlib version: 0.9.1

Additional Notes

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions