def __init__(self, start_date='2015-01-07', end_date='2015-01-20', cfg=None): login() self.cfg = cfg #self.stock_list = stock_list self.start_date = start_date self.end_date = end_date self.initDateIndexDict()
daily_label_info = {"info":label,"valid_index":valid_index} return daily_label_info def creatDailyLabel(self,date,stock_list): daily_label_dict = dict() daily_label_dict["label_all"] = dict() daily_label_dict["label_all"][date] = self.creatLabelByDate(date,stock_list) daily_label_dict["date_index"] = {0:date} return daily_label_dict def checkLabel(): for creator in self.label_creator_list: creator.check(self.start_date) if __name__ == "__main__": import json from util.jq_init import login login() from data_interface.data_api import UserDataApi UserDataApi = UserDataApi() feature_cfg = "./config/feature_create_cfg.json" with open(feature_cfg,"r") as f: feature_cfg = json.load(f) stock_list = jq.get_industry_stocks('I64') f = Label(feature_cfg,UserDataApi) label_all = f.createLabelAll(stock_list) print (label_all["label_all"]["2020-03-04"]["valid_index"])