def data_standardize_money163(stock_code, index_code='000001.SH'):
    # 1.读取万得的股票数据
    stock_data = Functions.import_stock_data_money163(stock_code)
    # 2.读取指数数据
    index_data = Functions.import_index_data_wande(index_code=index_code)
    # 3.个股数据除权处理, 默认后复权,直接替换OLHC列
    stock_data = Functions.cal_adjust_price(stock_data)
    # 3.合并个股数据和指数数据
    stock_data = Functions.merge_with_index_data(stock_data, index_data)
    # 4.添加涨跌停列
    stock_data = Functions.limit_up_down(stock_data)
    return stock_data
Example #2
0
pd.set_option('expand_frame_repr', False)

# ====1 测试个股数据导入
# 1.1 测试万得个股数据读取
# stock_data = Functions.import_stock_data_wande('000001.SZ')
# print stock_data['date']
# exit()

# 1.2 测试xbx个股数据读取
# stock_data = Functions.import_stock_data_xbx('sh600000')
# print stock_data
# exit()

# 1.3 测试money163个股数据读取
stock_data = Functions.import_stock_data_money163('000001')
# df['change'] = df['change'].astype('float')
print stock_data
# print df['change'].astype('float', inplace=True)
# print df['change'].astype('float')
exit()

# 2 测试指数数据导入
# 2.1 测试大盘数据读取 万得
# index_code='000001.SH'
# index_data = Functions.import_index_data_wande()
# print index_data['date']
# exit()

# 2.2 测试大盘数据读取 xbx
# index_code='sh000001'