Skip to content

Commit

Permalink
version0.11.3
Browse files Browse the repository at this point in the history
  • Loading branch information
refraction-ray committed Jan 31, 2021
1 parent 7ad63c5 commit d3e9316
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## v0.11.3 - 2021.01.31

### added

- 场内账单增加忽略基金的 # 前缀支持
Expand All @@ -10,12 +12,16 @@

- 更新了主流国际市场 2021 休市日

- 增加了可转债工具箱对 B 评级可转债的支持

### fixed

- 进一步修改申购费自定义的小数点错误:第一笔申购情形

- 修复了 _float 中遇到百分数的 bug

- 转2修正为可转债类型

## v0.11.2 - 2021.01.01

### added
Expand Down
1 change: 0 additions & 1 deletion doc/samples/qdiipred.py
Expand Up @@ -49,7 +49,6 @@ def cached_get_bar(code, *args, **kws):
"SZ164824",
"SH513030",
"SZ160140",
"SZ161714",
"SZ165510",
"SZ164906",
"SH513050",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -16,7 +16,7 @@

setuptools.setup(
name="xalpha",
version="0.11.2",
version="0.11.3",
author="refraction-ray",
author_email="refraction-ray@protonmail.com",
description="all about fund investment",
Expand Down
2 changes: 1 addition & 1 deletion xalpha/__init__.py
@@ -1,4 +1,4 @@
__version__ = "0.11.2"
__version__ = "0.11.3"
__author__ = "refraction-ray"
__name__ = "xalpha"

Expand Down
6 changes: 3 additions & 3 deletions xalpha/toolbox.py
Expand Up @@ -829,7 +829,7 @@ def process_byday(self, date=None):
) * np.sqrt(244)
if not self.refvolatility:
self.volatility = 0.17
if self.rating in ["A-", "A", "A+"]:
if self.rating in ["A-", "A", "A+"] or self.rating.startswith("B"):
self.volatility = 0.25
elif self.rating in ["AA-"]:
self.volatility = 0.2
Expand All @@ -855,9 +855,9 @@ def process_byday(self, date=None):
).days
if not self.refbondrate:
ratestable = get_bond_rates(self.rating, self.date_obj.strftime("%Y-%m-%d"))
if self.rating in ["A", "A+", "AA-"]:
if self.rating in ["A", "A+", "AA-"] or self.rating.startswith("B"):
## AA 到 AA- 似乎是利率跳高的一个坎
cutoff = 2
cutoff = 3 # changed from 2 by considering more credit risk
else:
cutoff = 4
if self.days / 365 > cutoff:
Expand Down
2 changes: 1 addition & 1 deletion xalpha/trade.py
Expand Up @@ -754,7 +754,7 @@ def get_type(self):
):
self.type_ = "场内基金"
elif code.startswith("SH11") or code.startswith("SZ12"):
if self.name.endswith("转债"):
if self.name.endswith("转债") or self.name.endswith("转2"):
self.type_ = "可转债"
else:
self.type_ = "债券"
Expand Down
7 changes: 6 additions & 1 deletion xalpha/universal.py
Expand Up @@ -869,7 +869,7 @@ def get_bond_rates(rating, date=None):
"""
rating = rating.strip()
rating_uid = {
"N": "2c9081e50a2f9606010a3068cae70001",
"N": "2c9081e50a2f9606010a3068cae70001", # 国债
"AAA": "2c9081e50a2f9606010a309f4af50111",
"AAA-": "8a8b2ca045e879bf014607ebef677f8e",
"AA+": "2c908188138b62cd01139a2ee6b51e25",
Expand All @@ -878,6 +878,11 @@ def get_bond_rates(rating, date=None):
"A+": "2c9081e91b55cc84011be40946ca0925",
"A": "2c9081e91e6a3313011e6d438a58000d",
"A-": "8a8b2ca04142df6a014148ca880f3046",
"A": "2c9081e91e6a3313011e6d438a58000d",
"BBB+": "2c9081e91ea160e5011eab1f116c1a59",
"BBB": "8a8b2ca0455847ac0145650780ad68fb",
"BB": "8a8b2ca0455847ac0145650ba23b68ff",
"B": "8a8b2ca0455847ac0145650c3d726901",
}
# 上边字典不全,非常欢迎贡献 :)
def _fetch(date):
Expand Down

0 comments on commit d3e9316

Please sign in to comment.