Skip to content

Commit

Permalink
v3.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
chen-001 committed Sep 19, 2022
1 parent eb6d6b4 commit 7c51325
Show file tree
Hide file tree
Showing 6 changed files with 334 additions and 169 deletions.
5 changes: 2 additions & 3 deletions pure_ocean_breeze/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
一个量化多因子研究的框架,包含数据、回测、因子加工等方面的功能
"""

__updated__ = "2022-09-16 10:32:33"
__version__ = "3.2.5"
__updated__ = "2022-09-19 17:34:33"
__version__ = "3.2.6"
__author__ = "chenzongwei"
__author_email__ = "[email protected]"
__url__ = "https://github.com/chen-001/pure_ocean_breeze"
Expand Down Expand Up @@ -203,7 +203,6 @@ def show_use_times():
from pure_ocean_breeze.mail import *
from pure_ocean_breeze.initialize import *

from pure_ocean_breeze.state.states import *
from pure_ocean_breeze.state.homeplace import *
from pure_ocean_breeze.state.decorators import *

Expand Down
7 changes: 3 additions & 4 deletions pure_ocean_breeze/data/write_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__updated__ = "2022-09-15 21:53:51"
__updated__ = "2022-09-18 01:53:55"

try:
import rqdatac
Expand Down Expand Up @@ -544,9 +544,8 @@ def database_update_daily_files() -> None:
homeplace = HomePlace()

def single_file(name):
df = pd.read_feather(homeplace.daily_data_file + name + ".feather").set_index(
"date"
)
df = pd.read_feather(homeplace.daily_data_file + name + ".feather")
df = df.set_index(list(df.columns)[0])
startdate = df.index.max() + pd.Timedelta(days=1)
return startdate

Expand Down
26 changes: 1 addition & 25 deletions pure_ocean_breeze/labor/comment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__updated__ = "2022-08-21 13:40:12"
__updated__ = "2022-09-19 15:23:25"

import numpy as np
import pandas as pd
Expand All @@ -10,7 +10,6 @@
plt.style.use(["science", "no-latex", "notebook"])
plt.rcParams["axes.unicode_minus"] = False
from pure_ocean_breeze.data.read_data import read_index_three, read_daily
from pure_ocean_breeze.labor.process import pure_moonnight


def comment_on_rets_and_nets(
Expand Down Expand Up @@ -231,30 +230,7 @@ def make_relative_comments_plot(
return net


def comments_ten(shen: pure_moonnight) -> pd.DataFrame:
"""对回测的十分组结果分别给出评价

Parameters
----------
shen : pure_moonnight
回测结果对象
Returns
-------
`pd.DataFrame`
评价指标包括年化收益率、总收益率、年化波动率、年化夏普比率、最大回撤率、胜率
"""
rets_cols = list(shen.shen.group_rets.columns)
rets_cols = rets_cols[:-1]
coms = []
for i in rets_cols:
ret = shen.shen.group_rets[i]
net = shen.shen.group_net_values[i]
com = comments_on_twins(net, ret)
com = com.to_frame(i)
coms.append(com)
df = pd.concat(coms, axis=1)
return df.T


def other_periods_comments_nets(
Expand Down
Loading

0 comments on commit 7c51325

Please sign in to comment.