def main_financial_data_process(path, path_res):
    stock_codes = financial_download.ts_stock_codes()
    # stock_codes = ['000719']
    for stock_code in stock_codes:
        print("stock:", stock_code)
        data_finance = load_financical_data(path, stock_code)
        data_processed = financial_index_calc(data_finance)
        store_process_financical_data(path_res, data_processed, stock_code)
def download_all_stocks():
    path_root = '../../../data/'
    #stock_codes = ['000001']
    stock_codes = FD.ts_stock_codes()
    #get_dates = ['2018/6/30']
    SB = stock_basic(stock_codes, path_root)
    #SB.get_stocks_basic()
    SB.get_all_stocks_basic()
    print('downloaded successfully')
Example #3
0
 except getopt.GetoptError:
   print('test.py -o <outputfile>')
   sys.exit(2)
 for opt, arg in opts:
   if opt == '-h':
     print('test.py -o <outputfile>')
     sys.exit()
   elif opt in ("-o", "--ofile"):
       outputfile = arg
   elif opt in ("-k", "--kmean"):
       k = int(arg)
 path = '../../../data/finance_processed'
 path_score = '../../../data/score'
 path_plot = '../../../data/figure'
 path_score_kmean = outputfile
 stocks = financial_download.ts_stock_codes()
 #stocks = ['000001','000002','000004','000005','000006']
 dates = ['2018-06-30']
 if not os.path.exists(path_plot):
     os.makedirs(path_plot)
 #k = 300
 FIR = financial_index_rank(path=path, path_score=path_score, stocks = stocks, dates = dates)
 indexs = [
   #earning capacity
   FID['roe'],\
   FID['roa'],\
   FID['profit_revenue'],\
   FID['profit_cost'],\
   FID['equlity_incr_rate'],\
   ###grow capacity
   FID['revenue_incr_rate'],\