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.4.tar.gz
(15.0 kB
view hashes)
Built Distribution
Close
Hashes for single_factor_model-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6362341f61c49a29a0dfc3fac2c1cc9bed09da27b94717ef89ed7b45a986daa2 |
|
MD5 | 08c2f9c5bd15eac9b33c2351668954b4 |
|
BLAKE2b-256 | 9be90480287c2c184aa33ba15718762ba5de221f0b85e4d85b757f6ce485f2a3 |
Close
Hashes for single_factor_model-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61d982c05a53047fcaf6aa01b2d75b696fcad0119575398a8911c5119ca1d8e6 |
|
MD5 | 3548f312ade02be84a73ccfdd54cff03 |
|
BLAKE2b-256 | dedd12dedea7d6538d26beacdace240ca31ed4b82ed2a837672a3fd511991310 |