def rolling_watchdog(eval): """ 滚动查询和发送系统消息到关联的微信号上面 """ codepool = [ '600332', '601888', '002230', '603444', '300715', '002007', '300750', '600887', '300122', '002271', '000333', '601318', '000661', '600036', '000651', '603520', '002705', '600519', '600009', '600900', '002714', '000538', '603486', '600309', '603259', '002475', '300059', '600276', '600600', '002050', '600612', '000858', '603288', '600031', '300015', '300146', '300760', '600563', '603713' ] codelist_candidate = get_codelist(codepool) codelist = codelist_candidate print(len(codelist), codelist) max_usage_of_cores = 4 # 少打印信息,多进程运行时打印调试信息会会刷疯狂屏 verbose = False alive_conter = 0 while (True): # 单线程读取测试 for code in codelist: analysis_stock(code, verbose) time.sleep(1) if ((QA_util_datetime_to_Unix_timestamp( datetime.now(timezone(timedelta(hours=8)))) - alive_conter) >= 60): alive_conter = QA_util_datetime_to_Unix_timestamp( datetime.now(timezone(timedelta(hours=8)))) print(u'%s WeChat/微信/Server酱信息推送提醒 Alive...' % (QA_util_timestamp_to_str( datetime.now(timezone(timedelta(hours=8))))))
gostrike(frequency='day', cpu_usage=cmdline_args.pct_of_cores, verbose=cmdline_args.verbose, eval_range=cmdline_args.eval) done = True elif (cmdline_args.strategy == 'void'): from GolemQ.benchmark.dodge_void import dodge_void dodge_void(cpu_usage=cmdline_args.pct_of_cores, verbose=cmdline_args.verbose, eval_range=cmdline_args.eval) done = True elif (cmdline_args.sub != False) and \ (cmdline_args.sub == 'sina_l1'): if (cmdline_args.codelist != False): # 收线,收线 sub_codelist_l1_from_sina(get_codelist(cmdline_args.codelist)) else: # 收线,收线 sub_l1_from_sina() done = True elif (cmdline_args.sub != False) and \ (cmdline_args.sub == 'huobi_realtime'): # 接收火币实时数据 from QUANTAXIS.QASU.save_huobi import ( QA_SU_save_huobi_realtime, ) QA_SU_save_huobi_realtime() done = True elif (cmdline_args.sub != False) and \ (cmdline_args.sub == 'huobi'): # 接收火币行情历史数据 from QUANTAXIS.QASU.save_huobi import (
#codepool = ['159919', '159997', '159805', '159987', # '159952', '159920', '518880', '159934', # '159985', '515050', '159994', '159941', # '512800', '515000', '512170', '512980', # '510300', '513100', '510900', '512690', # '510050', '159916', '512910', '510310', # '512090', '513050', '513030', '513500', # '159905', '159949', '510330', '510500', # '510180', '159915', '510810', '159901', # '512710', '510850', '512500', '512000',] # 我改进了 get_codelist 这个函数,为的是别人QQ发过来的一大串股票代码, # 我不用整理出上面的list,直接灌QA进去也能读取行情。 codepool = ''' 601801, 603028 600519, ''' codelist_candidate = get_codelist(codepool) codelist = codelist_candidate #codelist = [code for code in codelist_candidate if not #code.startswith('300')] #codelist = ['300386', '300402'] print(len(codelist), codelist) verbose = True # 如果不要罗里吧嗦,就设置为False # 计算策略主时间周期:日线 data_day, codename = get_kline_price(codelist, verbose=verbose) if (len(data_day.data) < 300): print(u'新股或者次新股,{}'.format(codename)) print(data_day.data.tail(12))