Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
42a6e725
Commit
42a6e725
authored
Jul 07, 2018
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update libs to new ipopt version
parent
99b252c3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
29 deletions
+21
-29
optimizers.pyx
alphamind/cython/optimizers.pyx
+16
-8
pfopt
alphamind/pfopt
+1
-1
strategy.py
alphamind/strategy/strategy.py
+3
-19
xgboost
xgboost
+1
-1
No files found.
alphamind/cython/optimizers.pyx
View file @
42a6e725
...
@@ -75,7 +75,8 @@ cdef extern from "tvoptimizer.hpp" namespace "pfopt":
...
@@ -75,7 +75,8 @@ cdef extern from "tvoptimizer.hpp" namespace "pfopt":
int,
int,
double*,
double*,
double*,
double*,
double*) except +
double*,
string) except +
vector[double] xValue()
vector[double] xValue()
double feval()
double feval()
int status()
int status()
...
@@ -98,7 +99,8 @@ cdef class CVOptimizer:
...
@@ -98,7 +99,8 @@ cdef class CVOptimizer:
double target_vol=1.0,
double target_vol=1.0,
cnp.ndarray[double, ndim=2] factor_cov_matrix=None,
cnp.ndarray[double, ndim=2] factor_cov_matrix=None,
cnp.ndarray[double, ndim=2] factor_loading_matrix=None,
cnp.ndarray[double, ndim=2] factor_loading_matrix=None,
double[:] idsync_risk=None):
double[:] idsync_risk=None,
str linear_solver="ma27"):
self.n = lbound.shape[0]
self.n = lbound.shape[0]
self.m = 0
self.m = 0
...
@@ -125,7 +127,8 @@ cdef class CVOptimizer:
...
@@ -125,7 +127,8 @@ cdef class CVOptimizer:
self.f,
self.f,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
&idsync_risk[0] if idsync_risk is not None else NULL)
&idsync_risk[0] if idsync_risk is not None else NULL,
bytes(linear_solver, encoding='utf8'))
else:
else:
self.cobj = new TVOptimizer(self.n,
self.cobj = new TVOptimizer(self.n,
&expected_return[0],
&expected_return[0],
...
@@ -140,7 +143,8 @@ cdef class CVOptimizer:
...
@@ -140,7 +143,8 @@ cdef class CVOptimizer:
self.f,
self.f,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
&idsync_risk[0] if idsync_risk is not None else NULL)
&idsync_risk[0] if idsync_risk is not None else NULL,
bytes(linear_solver, encoding='utf8'))
def __dealloc__(self):
def __dealloc__(self):
del self.cobj
del self.cobj
...
@@ -170,7 +174,8 @@ cdef extern from "mvoptimizer.hpp" namespace "pfopt":
...
@@ -170,7 +174,8 @@ cdef extern from "mvoptimizer.hpp" namespace "pfopt":
int,
int,
double*,
double*,
double*,
double*,
double*) except +
double*,
string) except +
vector[double] xValue()
vector[double] xValue()
double feval()
double feval()
int status()
int status()
...
@@ -209,7 +214,8 @@ cdef class QPOptimizer:
...
@@ -209,7 +214,8 @@ cdef class QPOptimizer:
double risk_aversion=1.0,
double risk_aversion=1.0,
cnp.ndarray[double, ndim=2] factor_cov_matrix=None,
cnp.ndarray[double, ndim=2] factor_cov_matrix=None,
cnp.ndarray[double, ndim=2] factor_loading_matrix=None,
cnp.ndarray[double, ndim=2] factor_loading_matrix=None,
double[:] idsync_risk=None):
double[:] idsync_risk=None,
str linear_solver='ma27'):
self.n = lbound.shape[0]
self.n = lbound.shape[0]
self.m = 0
self.m = 0
...
@@ -239,7 +245,8 @@ cdef class QPOptimizer:
...
@@ -239,7 +245,8 @@ cdef class QPOptimizer:
self.f,
self.f,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
&idsync_risk[0] if idsync_risk is not None else NULL)
&idsync_risk[0] if idsync_risk is not None else NULL,
bytes(linear_solver, encoding='utf8'))
else:
else:
self.cobj = new MVOptimizer(self.n,
self.cobj = new MVOptimizer(self.n,
&expected_return[0],
&expected_return[0],
...
@@ -254,7 +261,8 @@ cdef class QPOptimizer:
...
@@ -254,7 +261,8 @@ cdef class QPOptimizer:
self.f,
self.f,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_cov[0] if factor_cov is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
&factor_loading[0] if factor_loading is not None else NULL,
&idsync_risk[0] if idsync_risk is not None else NULL)
&idsync_risk[0] if idsync_risk is not None else NULL,
bytes(linear_solver, encoding='utf8'))
def __dealloc__(self):
def __dealloc__(self):
del self.cobj
del self.cobj
...
...
pfopt
@
148fd8ee
Subproject commit
b78ad8a55855c448a866f91a3876a271a52d68a1
Subproject commit
148fd8eedca5aeff85d90e6374658d96316e7f66
alphamind/strategy/strategy.py
View file @
42a6e725
...
@@ -319,26 +319,10 @@ if __name__ == '__main__':
...
@@ -319,26 +319,10 @@ if __name__ == '__main__':
neutralized_risk
=
None
neutralized_risk
=
None
alpha_factors
=
{
alpha_factors
=
{
'ep_q_cs'
:
CSQuantiles
(
LAST
(
'ep_q'
),
groups
=
'sw1_adj'
),
'ep_q_cs'
:
CSQuantiles
(
LAST
(
'ep_q'
),
groups
=
'sw1_adj'
)
'roe_q_cs'
:
CSQuantiles
(
LAST
(
'roe_q'
),
groups
=
'sw1_adj'
),
'OperatingRevenueGrowRate_cs'
:
CSQuantiles
(
LAST
(
'OperatingRevenueGrowRate'
),
groups
=
'sw1_adj'
),
'GREV_cs'
:
CSQuantiles
(
LAST
(
'GREV'
),
groups
=
'sw1_adj'
),
'con_peg_rolling_cs'
:
CSQuantiles
(
LAST
(
'con_peg_rolling'
),
groups
=
'sw1_adj'
),
'con_pe_rolling_order_cs'
:
CSQuantiles
(
LAST
(
'con_pe_rolling_order'
),
groups
=
'sw1_adj'
),
'IVR_cs'
:
CSQuantiles
(
LAST
(
'IVR'
),
groups
=
'sw1_adj'
),
'ILLIQUIDITY_cs'
:
CSQuantiles
(
LAST
(
'ILLIQUIDITY'
)
*
LAST
(
'NegMktValue'
),
groups
=
'sw1_adj'
),
'DividendPaidRatio_cs'
:
CSQuantiles
(
LAST
(
'DividendPaidRatio'
),
groups
=
'sw1_adj'
),
}
}
weights
=
dict
(
ep_q_cs
=
1.
,
weights
=
dict
(
ep_q_cs
=
1.
)
roe_q_cs
=
1.
,
OperatingRevenueGrowRate_cs
=
1.
,
GREV_cs
=
0.5
,
con_peg_rolling_cs
=-
0.25
,
con_pe_rolling_order_cs
=-
0.5
,
IVR_cs
=
0.5
,
ILLIQUIDITY_cs
=
0.5
,
DividendPaidRatio_cs
=
0.5
)
alpha_model
=
ConstLinearModel
(
features
=
alpha_factors
,
weights
=
weights
)
alpha_model
=
ConstLinearModel
(
features
=
alpha_factors
,
weights
=
weights
)
...
@@ -415,4 +399,4 @@ if __name__ == '__main__':
...
@@ -415,4 +399,4 @@ if __name__ == '__main__':
return
ret_df
return
ret_df
create_scenario
(
0.01
,
target_vol
=
0.02
,
method
=
'tv'
)
create_scenario
(
0.01
,
target_vol
=
0.01
,
method
=
'tv'
)
\ No newline at end of file
\ No newline at end of file
xgboost
@
a187ed6c
Subproject commit
5cd851ccef8cf0a0a71094d0d0e33a9d102f1f55
Subproject commit
a187ed6c8f3aa40b47d5be80667cbbe6a6fd563d
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment