You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
# xnquant data loader
|
|
|
|
This module is for dev to load stock data. Install from local pypi server http://192.168.1.125:8080/simple .
|
|
|
|
load_1day_kline返回end_time及前30自然日内的日频k线数据。
|
|
|
|
load_1min_kline返回end_time当日的分钟频k线数据。
|
|
|
|
load_1day_industry返回end_time及前30自然日内的日频k线数据。
|
|
|
|
load_factors返回end_time及前30自然日内的指定因子数据。
|
|
|
|
## Install
|
|
|
|
```bash
|
|
pip install --index-url http://192.168.1.125:8080/simple xnquant_data_loader --trusted-host 192.168.1.125
|
|
```
|
|
|
|
## Update
|
|
|
|
```bash
|
|
pip install --index-url http://192.168.1.125:8080/simple xnquant_data_loader --trusted-host 192.168.1.125 -U --force
|
|
```
|
|
|
|
|
|
## Usage
|
|
|
|
```python3
|
|
from xnquant_data_loader import load_1min_kline, load_1day_kline, load_1day_industry, load_factors
|
|
|
|
print("\n--- 测试 1: 1min K线 ---")
|
|
df_kline = load_1min_kline(
|
|
end_time="2024-01-02T00:00:00Z",
|
|
)
|
|
print(df_kline.head())
|
|
|
|
print("\n--- 测试 2: 1day K线 ---")
|
|
df_kline = load_1day_kline(
|
|
end_time="2025-10-30T00:00:00Z",
|
|
)
|
|
print(df_kline.head())
|
|
print(df_kline.shape)
|
|
|
|
print("\n--- 测试 3: 1day 行业信息 ---")
|
|
df_kline = load_1day_industry(
|
|
end_time="2025-10-30T00:00:00Z",
|
|
)
|
|
print(df_kline.head())
|
|
print(df_kline.shape)
|
|
```
|
|
|