-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_main.py
73 lines (62 loc) · 2.09 KB
/
test_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -*-coding: utf-8 -*-
# Python 3.6
# Author:Zhang Haitao
# Email:[email protected]
# TIME:2018-04-01 11:31
# NAME:assetPricing2-test_main.py
from old.main import OneFactor, Bivariate
def test_Onefactor():
# factor = 'beta'
# path = r'D:\zht\database\quantDb\researchTopics\assetPricing2\beta'
# beta = OneFactor(factor, path)
# beta()
factor='size'
path=r'D:\zht\database\quantDb\researchTopics\assetPricing2\size'
size=OneFactor(factor,path)
size()
# factor='value'
# path=r'D:\zht\database\quantDb\researchTopics\assetPricing2\value'
# value=OneFactor(factor,path)
# value()
#
# factor = 'momentum'
# path = r'D:\zht\database\quantDb\researchTopics\assetPricing2\mom'
# mom = OneFactor(factor, path)
# mom()
#
# factor='reversal'
# path=r'D:\zht\database\quantDb\researchTopics\assetPricing2\reversal'
# rev=OneFactor(factor,path)
# rev()
#
# factor='skewness'
# path=r'D:\zht\database\quantDb\researchTopics\assetPricing2\skewness'
# skewness=OneFactor(factor,path)
# skewness()
#
# factor='idiosyncraticVolatility'
# path=r'D:\zht\database\quantDb\researchTopics\assetPricing2\idiosyncraticVolatility'
# idiosyn=OneFactor(factor,path)
# idiosyn()
class size_12M(Bivariate):
def __init__(self):
indicator1='size'
indicator2='D_12M'
path=r'D:\zht\database\quantDb\researchTopics\assetPricing2\size_12M'
super().__init__(indicator1,indicator2,path)
#TODO: how to send paramters into a class method without inherit and overide the method
def fm(self):
ll_indeVars = [['bm'], ['bm', 'M_12M'], ['bm', 'size'], ['bm', 'M_12M', 'size'],
['logbm'], ['logbm', 'M_12M'], ['logbm', 'size'], ['logbm', 'M_12M', 'size']]
super()._fm(ll_indeVars)
def run(self):
# self.dependent_portfolio_analysis()
# self.independent_portfolio_analysis()
self.fm()
def __call__(self):
self.run()
def test_Bivariate():
size_12M()()
if __name__=='__main__':
test_Onefactor()
# test_Bivariate()