def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = ['PB', 'turnover_ratio', 'volume', 'pe_ttm'] check_factor = ','.join(factor_list) dataview_folder = r'E:\BaiduNetdiskDownload\data\data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start = 20170101,end = 20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'alpha190', 'alpha96', 'DebtEquityRatio', 'NetAssetGrowRate', 'SharpeRatio120', 'RC12' ,'InformationRatio20'] check_factor = ','.join(factor_list) dataview_folder = r'../data' ds = LocalDataService(fp = dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = {'start_date': start, 'end_date': end, 'symbol':','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True} dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start = 20170101,end = 20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = ['TSEPToTotalCapital','alpha107','TRIX5_J','OperatingRevenueGrowRate_J','LossVariance60','BIAS60_J','alpha110','DIZ_J'] check_factor = ','.join(factor_list) dataview_folder = r'E:/data/data' ds = LocalDataService(fp = dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = {'start_date': start, 'end_date': end, 'symbol':','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True} dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import warnings warnings.filterwarnings("ignore") try: import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService except ImportError as e: _handle_import_exception(e) ds = LocalDataService(fp=get_data_root()) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': "", 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() hs300_benchmark = dv.data_api.daily("000300.SH", dv.extended_start_date_d, dv.end_date, fields='trade_date,close') dv.data_benchmark = hs300_benchmark[0][['trade_date', 'close']].set_index('trade_date') return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") factor_list = [ 'alpha60', 'alpha61', 'SRMI', 'OperatingProfitGrowRate', 'InterestCover_J', 'ROECut', 'StaticPE_J', 'VOL60' ] check_factor = ','.join(factor_list) dataview_folder = r'../data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start = 20170101,end = 20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = ['BBI', 'net_profit', 'tot_shrhldr_eqy_excl_min_int' # ,'EPS','PE','PS','ACCA','CTOP','MA10RegressCoeff12','AR','BR','ARBR','np_parent_comp_ttm','total_share','bps' ] check_factor = ','.join(factor_list) dataview_folder = r'../data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = {'start_date': start, 'end_date': end, 'symbol':','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True} dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'volume', 'tot_profit', 'plus_non_oper_rev', 'less_non_oper_exp', 'net_cash_flows_oper_act', 'total_oper_rev', 'tot_oper_cost', 'fin_exp', 'less_selling_dist_exp', 'less_gerl_admin_exp', 'oper_rev', 'less_oper_cost', 'turnover' ] check_factor = ','.join(factor_list) dataview_folder = 'G:\GSICE\DATA\data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() data_config = { "remote.data.address": "tcp://data.tushare.org:8910", "remote.data.username": "******", "remote.data.password": "******" } from jaqs_fxdayu.data import RemoteDataService Ds = RemoteDataService() Ds.init_from_config(data_config) dv.add_field('pe', Ds) return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs_fxdayu.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = ['fcffps', 'lt_borrow', 'st_borrow', 'LCAP', 'end_bal_cash'] check_factor = ','.join(factor_list) dataview_folder = r'D:/data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() # total market value data_config = { "remote.data.address": "tcp://data.tushare.org:8910", "remote.data.username": "******", "remote.data.password": "******" } from jaqs_fxdayu.data.dataservice import RemoteDataService ds1 = RemoteDataService() ds1.init_from_config(data_config) dv.add_field('total_mv', ds1) dv.add_field('ncf_oper_ttm', ds1) return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") # -------------------------------------------------------- # define factor_list = [ 'np_parent_comp_ttm', 'tot_cur_liab', 'cogstosales', 'oper_rev_ttm', 'tangibleasset', 'interestdebt' ] check_factor = ','.join(factor_list) dataview_folder = r'd:/data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) ben_ret = list(ds.index_daily(['000300.SH'], start, end, 'close'))[0] dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'SaleServiceCashToOR', 'alpha158', 'CoppockCurve', 'OperatingProfitRatio', 'alpha147', 'alpha57', 'EquityFixedAssetRatio', 'alpha1', 'alpha2', 'alpha3', 'alpha4', 'alpha5', 'alpha6', 'alpha7', 'alpha8', 'alpha9', 'alpha10' ] check_factor = ','.join(factor_list) dataview_folder = r'F:/data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv, ds
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'capital_stk', 'cash_cash_equ_end_period', 'oper_rev', 'acct_rcv', 'adv_from_cust', 'adv_from_cust', 'oper_profit', 'less_oper_cost', 'inventories', 'ARTRate', 'ARTDays', 'InventoryTDays', 'AccountsPayablesTDays', 'DAVOL5', 'AD' ] check_factor = ','.join(factor_list) dataview_folder = r'../data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'close', 'pb', 'roe', 'net_profit', 'pe', 'volume', 'capital_stk', 'tot_profit', 'less_int_exp', 'int_income', 'total_liab', 'end_bal_cash', 'tot_cur_assets', 'tot_cur_liab', 'tot_non_cur_liab', 'tot_assets' ] check_factor = ','.join(factor_list) dataview_folder = r'E://股票因子数据/data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'alpha33', 'alpha58', 'alpha114', 'alpha173', 'LongDebtToWorkingCapital', 'OperCashGrowRate', 'Kurtosis120', 'Beta252' ] check_factor = ','.join(factor_list) dataview_folder = r'F:/data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'tot_profit', 'less_oper_cost', 'less_fin_exp', 'less_selling_dist_exp', 'less_gerl_admin_exp', 'monetary_cap', 'tradable_assets', 'notes_rcv', 'acct_rcv', 'other_rcv', 'tot_cur_liab' ] check_factor = ','.join(factor_list) dataview_folder = r'data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'recover_l', 'recover_s', 'trend60', 'BollUp_turnover', 'BollDown_turnover', 'factor_PV', 'AD_close60', 'AD_hl60', 'r_adj80', 'pca', 'turnover_ratio', 'total_mv', 'tot_cur_assets' ] check_factor = ','.join(factor_list) dataview_folder = r'D:\my_data\量化云实习\data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'alpha84', 'alpha88', 'alpha99', 'alpha133', 'Rstr504', 'GainVariance60', 'ARTDays', 'BollDown', 'acct_rcv', 'notes_rcv', 'adv_from_cust' ] check_factor = ','.join(factor_list) dataview_folder = r'D:\my_data\量化云实习\data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") # -------------------------------------------------------- # define factor_list = [ 'total_share', 'oper_profit', 'oper_rev', 'float_mv', 'net_cash_flows_oper_act', 'ps' ] check_factor = ','.join(factor_list) dataview_folder = r'H:/sxzy/data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") # -------------------------------------------------------- # define factor_list = [ 'volume', 'net_profit', 'oper_rev', 'fix_assets', 'proj_matl', 'const_in_prog', 'turnover_ratio' ] check_factor = ','.join(factor_list) dataview_folder = r'C:\Users\微软\Desktop\data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'alpha01a', 'alpha02a', 'alpha03a', 'alpha04a', 'alpha05a', 'alpha06a', 'alpha07a', 'alpha08a', 'alpha09a', 'alpha10a' ] check_factor = ','.join(factor_list) dataview_folder = r'f:/data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
def get_dv(start=20170101, end=20180101): import jaqs_fxdayu jaqs_fxdayu.patch_all() from jaqs.data import DataView from jaqs_fxdayu.data.dataservice import LocalDataService import warnings warnings.filterwarnings("ignore") #-------------------------------------------------------- #define factor_list = [ 'AroonDown', 'TVMA20', 'CurrentRatio', 'RSI', 'VOL10', 'minusDI' ] check_factor = ','.join(factor_list) dataview_folder = r'G:/BaiduYunDownload/data/data' ds = LocalDataService(fp=dataview_folder) ZZ800_id = ds.query_index_member("000906.SH", start, end) stock_symbol = list(set(ZZ800_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data() return dv
#-------------------------------------------------------- #define start = 20170101 end = 20180101 factor_list = [ 'BBI', 'RVI', 'Elder', 'ChaikinVolatility', 'EPS', 'PE', 'PS', 'ACCA', 'CTOP', 'MA10RegressCoeff12', 'AR', 'BR', 'ARBR', 'np_parent_comp_ttm', 'total_share', 'bps' ] check_factor = ','.join(factor_list) dataview_folder = r'D:/data' ds = LocalDataService(fp=dataview_folder) SH_id = ds.query_index_member("000001.SH", start, end) SZ_id = ds.query_index_member("399106.SZ", start, end) stock_symbol = list(set(SH_id) | set(SZ_id)) dv_props = { 'start_date': start, 'end_date': end, 'symbol': ','.join(stock_symbol), 'fields': check_factor, 'freq': 1, "prepare_fields": True } dv = DataView() dv.init_from_config(dv_props, data_api=ds) dv.prepare_data()