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
1f6a5f4d
Commit
1f6a5f4d
authored
Apr 10, 2025
by
stephen.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加入jf_etf
parent
a1d27c22
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
66 deletions
+60
-66
config-jf_etf.yml
config-jf_etf.yml
+55
-65
solver.py
portfolios/solver.py
+5
-1
No files found.
config-
stable_prr3_t
.yml
→
config-
jf_etf
.yml
View file @
1f6a5f4d
...
...
@@ -30,17 +30,17 @@ py-jftech:
level
:
${LOG_LEVEL:INFO}
handlers
:
${LOG_HANDLERS:[ console ]}
database
:
host
:
${MYSQL_HOST:192.168.68.
85
}
host
:
${MYSQL_HOST:192.168.68.
100
}
port
:
${MYSQL_PORT:3306}
user
:
${MYSQL_USER:root}
password
:
${MYSQL_PWD:
changeit
}
dbname
:
${MYSQL_DBNAME:
stable_prr3_t}
# stable_prr3
password
:
${MYSQL_PWD:
12345678
}
dbname
:
${MYSQL_DBNAME:
jf_etf}
injectable
:
names
:
backtest
:
robo_executor.BacktestExecutor
datum
:
basic.datum.DefaultDatum
hold-report
:
portfolios.holder.DivHoldReportor
mpt
:
portfolios.builder.RiskParityARCPortfoliosBuilder
# PoemARCPortfoliosBuilder
mpt
:
portfolios.builder.RiskParityARCPortfoliosBuilder
# PoemARCPortfoliosBuilder
, RiskParityARCPortfoliosBuilder
dividend-holder
:
portfolios.holder.InvTrustPortfoliosHolder
navs-sync
:
basic.sync.FundNavSync
email
:
...
...
@@ -57,25 +57,10 @@ basic: # 基础信息模块
date
:
${DATUM_CHANGE_DATE}
file
:
${DATUM_CHANGE_FILE}
excludes
:
# 排除的资料彭博ticker
backtest
:
-
'
LCUAGAA
ID
Equity'
# 美盛凱利美國積極成長基金 A 美元 累積
-
'
TEMASAA
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-亞洲債券基金 美元A(acc)股
-
'
TEMEMAU
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-新興國家固定收益基金 美元A(acc)股
-
'
FTGBFAC
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-全球債券基金 美元A(acc)股
-
'
TGTRFAA
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-全球債券總報酬基金 美元A(acc)股
-
'
TGHYACU
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-全球非投資等級債券基金美元A(acc)股
-
'
LEGOUAA
ID
Equity'
# 美盛布蘭迪全球固定收益基金 A 美元 累積
-
'
LGBOAAU
ID
Equity'
# 美盛布蘭迪全球機會固定收益基金 A 美元 累積
# - 'TEMFHAC LX Equity' # 富蘭克林坦伯頓全球投資系列-公司債基金 美元A(acc)股 -> 20240722起可一般申购
# backtest:
# - 'FKRCX US Equity' # 富蘭克林黃金基金 美元 A(Ydis)
real
:
-
'
LCUAGAA
ID
Equity'
# 美盛凱利美國積極成長基金 A 美元 累積
-
'
TEMASAA
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-亞洲債券基金 美元A(acc)股
-
'
TEMEMAU
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-新興國家固定收益基金 美元A(acc)股
-
'
FTGBFAC
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-全球債券基金 美元A(acc)股
-
'
TGTRFAA
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-全球債券總報酬基金 美元A(acc)股
-
'
TGHYACU
LX
Equity'
# 富蘭克林坦伯頓全球投資系列-全球非投資等級債券基金美元A(acc)股
-
'
LEGOUAA
ID
Equity'
# 美盛布蘭迪全球固定收益基金 A 美元 累積
-
'
LGBOAAU
ID
Equity'
# 美盛布蘭迪全球機會固定收益基金 A 美元 累積
-
'
XXX
LX
Equity'
navs
:
# 净值模块
exrate
:
# 汇率,如果不开启,整个这块注释掉
-
from
:
EUR
# 需要转换的货币类型
...
...
@@ -89,14 +74,24 @@ asset-pool: # 资产池模块
weight
:
0.3
-
years
:
1
weight
:
0.2
asset-include
:
{
'
customType'
:[
1
,
2
,
3
,
4
]}
optimize-count
:
4
#基金优选个数
# - months: 1
# weight: 0.3
# - months: 2
# weight: 0.25
# - months: 3
# weight: 0.2
# - months: 6
# weight: 0.15
# - years: 1
# weight: 0.1
asset-include
:
{
'
customType'
:[
1
,
2
,
3
]}
optimize-count
:
3
#基金优选个数
annual-volatility-filter
:
#1各资产年化波动率末exclude位 2各资产年化波动率大于volatility
-
customType
:
2
# none
min-retain
:
4
exclude
:
0
volatility
:
1000
-
customType
:
3
# none
# - customType: 1
#
min-retain: 4
#
exclude: 0
#
volatility: 1000
-
customType
:
5
min-retain
:
4
exclude
:
0
volatility
:
1000
...
...
@@ -116,7 +111,7 @@ portfolios: # 投组模块
model
:
prr
# 结算模型 ARC ,PRR, ~ 标准解算器
arc
:
on
#是否开启ARC
brr
:
0.0
#误差补偿值
trr
:
3
trr
:
5
tol
:
1E-10
# 误差满足条件
navs
:
# 净值要求
range
:
# 需要净值数据的区间, days: 90 表示90自然日,months: 3 表示3个自然月
...
...
@@ -125,15 +120,8 @@ portfolios: # 投组模块
asset
:
8
# 单一资产最多缺少多少交易日数据,则踢出资产池
day
:
0.5
# 单一交易日最多缺少百分之多少净值,则删除该交易日
risk
:
[]
# 资产风险等级要求,可分开写也可以合并写,e.g. risk:[ 2, 3 ] 则表示 所有投组资产风险等级都是 2 或 3
LARC
:
[
0.15
,
0.00
,
0.00
,
0.00
]
#低阈值
UARC
:
[
0.35
,
0.75
,
0.75
,
0.75
]
#高阈值
fix-w
:
0.01
fdtr-w
:
0.02
cpiyoy-w
:
0.1
cpi-expect
:
2
max-w
:
0.75
uarc-index
:
3
larc-index
:
3
LARC
:
[
0.00
,
0.00
,
0.00
]
#低阈值
UARC
:
[
0.70
,
0.70
,
0.55
]
#高阈值
matrix-rtn-days
:
20
# 计算回报率矩阵时,回报率滚动天数
asset-count
:
[
5
,
5
]
# 投组资产个数。e.g. count 或 [min, max] 分别表示 最大最小都为count 或 最小为min 最大为max,另外这里也可以类似上面给不同风险等级分别配置
mpt
:
# mpt计算相关
...
...
@@ -141,6 +129,8 @@ portfolios: # 投组模块
quantile
:
0.9
# 分位点,也可以给不同风险等级分别配置
low-weight
:
0.05
# 最低权重
high-weight
:
[
0.50
]
# 最高权重比例,可给一个值,也可以给多个值,当多个值时,第一个表示只有一个资产时权重,第二个表示只有两个资产时权重,以此类推,最后一个表示其他资产个数时的权重
short-term-strength
:
off
jf_etf
:
on
poem
:
# poem相关
cvar-scale-factor
:
0.1
# 计算时用到的系数
checker
:
#投组检测模块
...
...
@@ -165,20 +155,22 @@ reports: # 报告模块相关
RR5
:
0.7
fixed-range
:
# 固定区间收益率
range-dates
:
# 固定起始截止日期
-
start
:
2008-01-01
end
:
2008-10-27
-
start
:
2011-05-02
end
:
2011-10-04
-
start
:
2013-05-08
end
:
2013-06-24
-
start
:
2014-09-03
end
:
2014-12-16
-
start
:
2015-04-28
end
:
2016-01-21
-
start
:
2015-06-12
end
:
2015-09-30
-
start
:
2015-12-25
end
:
2016-01-29
-
start
:
2018-01-26
end
:
2018-1
0-29
-
start
:
2020-0
1-20
end
:
2018-1
2-28
-
start
:
2020-0
3-05
end
:
2020-03-23
-
start
:
2021-02-10
end
:
2022-05-09
-
start
:
2022-07-04
end
:
2022-10-31
-
start
:
2023-02-01
end
:
2024-02-02
-
start
:
2024-05-20
end
:
2024-09-13
relative-range
:
# 相对区间收益率
range-dates
:
# 相对时间周期
-
days
:
1
...
...
@@ -222,21 +214,19 @@ reports: # 报告模块相关
# - month-div-rate-report # 月度配息率比较
# - year-div-rate-report # 年度配息率比较
real-daily
:
file-name
:
SteadyFoF_prr3
(實盤)-每月投組推薦
file-name
:
IndustryFoF_prr5
(實盤)-每月投組推薦
include-report
:
# - daily-hold-report
-
daily-signal-report
# - daily-mpt-report
email
:
receives
:
-
brody_wu@chifufund.com
copies
:
-
wenwen.tang@thizgroup.com
receives
:
${REAL_EMAIL_RECEIVES:['brody_wu@chifufund.com']}
copies
:
${REAL_EMAIL_COPIES:['wenwen.tang@thizgroup.com']}
subject
:
# default: "
SteadyFoF_prr3(實盤)
-每日投組推薦_{today}"
rebalance
:
"
SteadyFoF_prr3
(實盤)-每月投組推薦_{today}"
# default: "
ROBO6_TAIBEI-实盘版
-每日投組推薦_{today}"
rebalance
:
"
IndustryFoF_prr5
(實盤)-每月投組推薦_{today}"
content
:
# default: "Dear All: 附
檔為今日投資組合推薦,請驗收,謝謝! 注>:該郵件為自動發送,如有問題請聯繫矽谷團隊 brody_wu
@chifufund.com"
# default: "Dear All: 附
件是今天生成的推薦組合,請驗收,謝謝! 注>:該郵件為自動發送,如有問題請聯繫矽谷團隊 telan_qian
@chifufund.com"
rebalance
:
"
Dear
All:
附檔為每月投資組合推薦,請驗收,謝謝!
注>:該郵件為自動發送,如有問題請聯繫矽谷團隊
brody_wu@chifufund.com"
daily-monitor
:
file-name
:
svROBO6_monitor
...
...
@@ -273,20 +263,20 @@ robo-executor: # 执行器相关
use
:
${ROBO_EXECUTOR:backtest}
# 执行哪个执行器,优先取系统环境变量ROBO_EXECUTOR的值,默认backtest
sync-data
:
${SYNC_DATA:on}
# 是否开启同步资料数据
backtest
:
# 回测执行器相关
start-date
:
20
23-10
-02
# 回测起始日期
end-date
:
202
4-10-01
# 回测截止日期
start-date
:
20
15-01
-02
# 回测起始日期
end-date
:
202
5-03-24
# 回测截止日期
sealing-period
:
10
#调仓封闭期
start-step
:
${BACKTEST_START_STEP:1}
# 回测从哪一步开始执行 1:计算资产池;2:计算最优投组:3:计算再平衡信号以及持仓投组
end-step
:
${BACKTEST_END_STEP:3}
# 回测从哪一步执行完成后结束执行 1:计算资产池;2:计算最优投组:3:计算再平衡信号以及持仓投组
clean-up
:
o
ff
clean-up
:
o
n
real
:
# 实盘执行器
export
:
${EXPORT_ENABLE:on}
# 是否开启报告
start-date
:
2023-05-08
# 实盘开始时间
include-date
:
[]
web
:
guid
:
AB088E61-FAB1-4466-B6AD-6E8AE253391E
port
:
8081
web
:
guid
:
D0FE0BF1-14F8-4350-833C-FD77AEE73E7A
port
:
8082
portfolios/solver.py
View file @
1f6a5f4d
...
...
@@ -88,6 +88,10 @@ class DefaultSolver(Solver):
@
property
def
risk_parity_sigma
(
self
):
if
self
.
get_config
(
'mpt.jf_etf'
):
rtn
=
(
self
.
navs
/
self
.
navs
.
shift
(
20
)
-
1
)[
1
:]
return
rtn
.
cov
()
*
252
else
:
return
self
.
navs
.
cov
()
@
property
...
...
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