Skip to content

Commit

Permalink
添加行业NHNLX信号
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo2046 committed Mar 7, 2023
1 parent ef26047 commit c7fa09d
Show file tree
Hide file tree
Showing 7 changed files with 27,907 additions and 815 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
alphalens==0.4.0
empyrical==0.5.5
gradient_free_optimizers==1.2.3
matplotlib==3.6.2
numpy==1.21.5
pandas==1.4.4
pyqlib==0.9.1
qlib==0.0.2.dev20
scikit_learn==1.2.1
seaborn==0.11.2
TA_Lib==0.4.19
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy==1.21.5
pandas==1.4.4
plotly==5.5.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
44 changes: 44 additions & 0 deletions C-择时类/行业指数顶部和底部信号/scr/load_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""
Author: hugo2046 [email protected]
Date: 2023-03-07 19:02:14
LastEditors: hugo2046 [email protected]
LastEditTime: 2023-03-07 19:28:33
Description: 数据加载
"""
import json
from typing import Dict

import pandas as pd

__all__ = [
"sw_cons_name",
"price",
"pivot_table",
"ind_price",
"pivot_ind_price",
"classify_num",
]

with open("data/sw_cons_name.json", "r") as f:

sw_cons_name: Dict = json.load(f)

price: pd.DataFrame = pd.read_csv("data/data.csv", index_col=[0], parse_dates=[0])

pivot_table: pd.DataFrame = pd.pivot_table(
price, index="trade_date", columns="code", values=["low", "high"]
)
pivot_table.index = pd.to_datetime(pivot_table.index)

ind_price: pd.DataFrame = pd.read_csv(
"data/industry_price.csv", index_col=[0], parse_dates=[0]
)

pivot_ind_price: pd.DataFrame = pd.pivot_table(
ind_price, index="trade_date", columns="name", values="close"
)
pivot_ind_price.index = pd.to_datetime(pivot_ind_price.index)

classify_num: pd.DataFrame = pd.read_csv(
"data/industry_classify_num.csv", index_col=[0], parse_dates=[0]
)
Loading

0 comments on commit c7fa09d

Please sign in to comment.