code list import

main
yz 2 years ago
parent e04de290bb
commit 1da5b089bf

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
from code_list_all import code_list_up, code_list_down from code_list_all_pkl import code_list as code_list_pickel_from_file
from TSLfm import TSLfm from TSLfm import TSLfm
from DDBfm import DDBfm from DDBfm import DDBfm
import pandas as pd import pandas as pd
@ -34,7 +34,12 @@ def run_add_1day_code_init_minKline(date, code_list):
def check_if_date_codelist_exists(typ, date, code_list): def check_if_date_codelist_exists(typ, date, code_list):
code_list_filtered = code_list code_list_filtered=[]
for c in code_list:
if c[-4:] >= date[2:6]:
code_list_filtered.append(c)
if not code_list_filtered:
return code_list_filtered
ddb1 = DDBfm(running_which_env) ddb1 = DDBfm(running_which_env)
if typ == 'tick': if typ == 'tick':
@ -140,10 +145,12 @@ def run():
def run_pool_dates_by_code_init_n_group(typ='mink', code_gp_amt=10, date_gp_amt=10, start_date='20220101', end_date='20221031', if_check=1, code_dict_by='init'): def run_pool_dates_by_code_init_n_group(typ='mink', code_gp_amt=10, date_gp_amt=10, start_date='20220101', end_date='20221031', if_check=1, code_dict_by='init'):
logger.info("Running run_pool_dates_by_group") logger.info("Running run_pool_dates_by_group")
code_list_pickel=code_list_down+code_list_up code_list_pickel=code_list_pickel_from_file
code_list_pickel=sorted(list(set()))
all_code_dict_by_init = {} all_code_dict_by_init = {}
for c in code_list_pickel: for c in code_list_pickel:
if c[-4:] < start_date[2:6]:
continue
init = c[:-4] init = c[:-4]
if init in all_code_dict_by_init: if init in all_code_dict_by_init:
all_code_dict_by_init[init].append(c) all_code_dict_by_init[init].append(c)

Loading…
Cancel
Save