Skip to content

Commit

Permalink
0.9.58 update
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed Aug 31, 2024
1 parent 68f7f23 commit 3aaa9cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def test_daily_performance():
# Test case 1: empty daily returns
result = daily_performance([])
assert result == {
"下行波动率": 0,
"绝对收益": 0,
"年化": 0,
"夏普": 0,
Expand All @@ -124,6 +125,7 @@ def test_daily_performance():
# Test case 2: daily returns with zero standard deviation
result = daily_performance([1, 1, 1, 1, 1])
assert result == {
"下行波动率": 0,
"绝对收益": 0,
"年化": 0,
"夏普": 0,
Expand All @@ -141,6 +143,7 @@ def test_daily_performance():
# Test case 3: daily returns with all zeros
result = daily_performance([0, 0, 0, 0, 0])
assert result == {
"下行波动率": 0,
"绝对收益": 0,
"年化": 0,
"夏普": 0,
Expand All @@ -159,6 +162,7 @@ def test_daily_performance():
daily_returns = np.array([0.01, 0.02, -0.01, 0.03, 0.02, -0.02, 0.01, -0.01, 0.02, 0.01])
result = daily_performance(daily_returns)
assert result == {
"下行波动率": 0.0748,
"绝对收益": 0.08,
"年化": 2.016,
"夏普": 5,
Expand All @@ -176,6 +180,7 @@ def test_daily_performance():
# Test case 5: normal daily returns with different input type
result = daily_performance([0.01, 0.02, -0.01, 0.03, 0.02, -0.02, 0.01, -0.01, 0.02, 0.01])
assert result == {
"下行波动率": 0.0748,
"绝对收益": 0.08,
"年化": 2.016,
"夏普": 5,
Expand Down

0 comments on commit 3aaa9cb

Please sign in to comment.