factor model
Project description
#---------- single sample:
from single_factor_model.single import preprocessing,back_testing,ic_measurement,ic_measure_summary,back_test_summary,bt_figure
parms={'factor_path':r'..\alpha_gen_factor'
,'ind_path':r'..\Industry'
,'ind_level':'level_name'
,'price_path':r'..\MktPrice'
,'cap_path':r'..\Cap'
,'index_weight_path':r'..\ZZ800_weight'
,'start_time':20170101
,'end_time':20180101
,'sub_factor':None
,'flag':'monthly'
,'day_lag':1
,'ind_mapping_flag':False
}
parms2={'n':5
,'silent':True # whether to output detail
}
parms3={'window':3
,'half_decay':200
}
P=preprocessing()
D=P(**parms)
T=back_testing(D)
B=T(**parms2)
T2=ic_measurement(D)
M=T2(**parms3)
Table0=ic_measure_summary(M)
Dict1,Table2,Dict3=back_test_summary(B)
Dict4=bt_figure(B,show_plot=True)
Table0.to_csv(r'E:\table0.csv')
from RNWS import write
write.write_dict(Dict1,path='E:',file_pattern='dict1')
#---------- multi sample:
from single_factor_model.multi import preprocessing,back_testing,ic_measurement,ic_measure_summary,back_test_summary,bt_figure
parms={'factor_path':r'..\alpha_gen_factor'
,'ind_path':r'..\Industry_num'
,'ind_level':'level_name'
,'price_path':r'..\MktPrice'
,'cap_path':r'..\Cap'
,'index_weight_path':r'..\ZZ800_weight'
,'start_time':20170101
,'end_time':20180101
,'sub_factor':None
,'day_lag':1
,'flag':'monthly'
,'processors':3
,'ind_mapping_flag':False
}
parms2={'n':5
,'silent':True
,'processors':3
}
parms3={'window':3
,'half_decay':200
,'processors':3
}
if __name__=='__main__':
P=preprocessing()
D=P(**parms)
T=back_testing(D)
B=T(**parms2)
T2=ic_measurement(D)
M=T2(**parms3)
Table0=ic_measure_summary(M)
Dict1,Table2,Dict3=back_test_summary(B)
Dict4=bt_figure(B,show_plot=True)
Table0.to_csv(r'E:\table0.csv')
from RNWS import write
write.write_dict(Dict1,path='E:',file_pattern='dict1')
from single_factor_model.single import preprocessing,back_testing,ic_measurement,ic_measure_summary,back_test_summary,bt_figure
parms={'factor_path':r'..\alpha_gen_factor'
,'ind_path':r'..\Industry'
,'ind_level':'level_name'
,'price_path':r'..\MktPrice'
,'cap_path':r'..\Cap'
,'index_weight_path':r'..\ZZ800_weight'
,'start_time':20170101
,'end_time':20180101
,'sub_factor':None
,'flag':'monthly'
,'day_lag':1
,'ind_mapping_flag':False
}
parms2={'n':5
,'silent':True # whether to output detail
}
parms3={'window':3
,'half_decay':200
}
P=preprocessing()
D=P(**parms)
T=back_testing(D)
B=T(**parms2)
T2=ic_measurement(D)
M=T2(**parms3)
Table0=ic_measure_summary(M)
Dict1,Table2,Dict3=back_test_summary(B)
Dict4=bt_figure(B,show_plot=True)
Table0.to_csv(r'E:\table0.csv')
from RNWS import write
write.write_dict(Dict1,path='E:',file_pattern='dict1')
#---------- multi sample:
from single_factor_model.multi import preprocessing,back_testing,ic_measurement,ic_measure_summary,back_test_summary,bt_figure
parms={'factor_path':r'..\alpha_gen_factor'
,'ind_path':r'..\Industry_num'
,'ind_level':'level_name'
,'price_path':r'..\MktPrice'
,'cap_path':r'..\Cap'
,'index_weight_path':r'..\ZZ800_weight'
,'start_time':20170101
,'end_time':20180101
,'sub_factor':None
,'day_lag':1
,'flag':'monthly'
,'processors':3
,'ind_mapping_flag':False
}
parms2={'n':5
,'silent':True
,'processors':3
}
parms3={'window':3
,'half_decay':200
,'processors':3
}
if __name__=='__main__':
P=preprocessing()
D=P(**parms)
T=back_testing(D)
B=T(**parms2)
T2=ic_measurement(D)
M=T2(**parms3)
Table0=ic_measure_summary(M)
Dict1,Table2,Dict3=back_test_summary(B)
Dict4=bt_figure(B,show_plot=True)
Table0.to_csv(r'E:\table0.csv')
from RNWS import write
write.write_dict(Dict1,path='E:',file_pattern='dict1')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
single_factor_model-0.0.6.tar.gz
(15.0 kB
view hashes)
Built Distribution
Close
Hashes for single_factor_model-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c64dad540d9b3868339e9cae0906274db13295032ee4467e8641bfb1a26d89a3 |
|
MD5 | afb204e0d6aa737fd73d3449dcb6f00a |
|
BLAKE2b-256 | a6931c6fa29d6551f026603284d84fecf2dfb5786e388f00b062c4dc4da55a8b |
Close
Hashes for single_factor_model-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da612daf4531d7a688ee1239d3651bfb1ff97e48c0f654986ea0340e28c47bc1 |
|
MD5 | 2bc083939f76d99112834e168647fa95 |
|
BLAKE2b-256 | 7522873cb08a096e5770a04c2242d76aeda03198f8f0a2ea303dc222c4c15cb8 |