Data sources
- Get data from Yahoo Finance by default
- Supports users to import their own data
Data acquisition methods
Use the following command to download sample data (China market).python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn
Data use
After initializing Qlib, data can be accessed as follows.qlib.init(provider_uri="~/.qlib/qlib_data/cn_data")
data = D.features(instruments, ["$close", "$volume"], start_time="2023-01-01", end_time="2025-03-25")
This answer comes from the articleQlib: an AI quantitative investment research tool developed by MicrosoftThe































