Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
R
robo-dividend
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
wenwen.tang
robo-dividend
Commits
734678f9
Commit
734678f9
authored
Mar 19, 2025
by
stephen.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在mpt中調整報酬率入參->加入(MA5/MA10-1),用短期趨勢強弱變化來製作組合
parent
c862f571
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
solver.py
portfolios/solver.py
+6
-2
No files found.
portfolios/solver.py
View file @
734678f9
...
...
@@ -75,8 +75,12 @@ class DefaultSolver(Solver):
@
property
def
rtn_annualized
(
self
):
return
list
(
self
.
rtn_matrix
.
mean
()
*
12
)
if
self
.
get_config
(
'mpt.short-term-strength'
):
result
=
self
.
navs
.
rolling
(
window
=
5
)
.
mean
()
/
self
.
navs
.
rolling
(
window
=
10
)
.
mean
()
-
1
result
.
dropna
(
inplace
=
True
)
return
list
(
result
.
iloc
[
-
1
])
else
:
return
list
(
self
.
rtn_matrix
.
mean
()
*
12
)
@
property
def
sigma
(
self
):
rtn
=
(
self
.
navs
/
self
.
navs
.
shift
(
1
)
-
1
)[
1
:]
...
...
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