Skip to content

Commit d38ee5c

Browse files
committed
chore: new code examples in main.py
1 parent 57ceed8 commit d38ee5c

File tree

1 file changed

+12
-25
lines changed

1 file changed

+12
-25
lines changed

main.py

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,18 @@
2525
portf.dcf.plot_forecast_monte_carlo(distr="norm", years=30, backtest=True, n=100)
2626

2727
s_periods = portf.dcf.monte_carlo_survival_period(distr="lognorm", years=25, n=10)
28-
print(f"медиана {s_periods.quantile(50 / 100)}")
29-
print(f"первый порцентиль {s_periods.quantile(1 / 100)}")
30-
print(f"99й порцентиль {s_periods.quantile(99 / 100)}")
31-
print(f"минимум {s_periods.min()}")
32-
print(f"среднее {s_periods.mean()}")
33-
34-
plt.show()
28+
print(f"median {s_periods.quantile(50 / 100)}")
29+
print(f"1st percentile {s_periods.quantile(1 / 100)}")
30+
print(f"99th percentile {s_periods.quantile(99 / 100)}")
31+
print(f"min {s_periods.min()}")
32+
print(f"max {s_periods.mean()}")
3533

3634
# Rolling / Expanding Risk
3735

38-
# al = ok.AssetList(['DJI.INDX',
39-
# 'BND.US'
40-
# ])
41-
# print(al)
42-
# al.get_rolling_risk_annual(window=12*20).plot()
43-
# # al.get_rolling_cagr(window=12*20, real=True).plot()
44-
#
45-
# plt.show()
46-
47-
# pf = ok.Portfolio(['SPY.US',
48-
# 'BND.US'
49-
# ])
50-
# rf3 = ok.Portfolio(
51-
# ["BND.US", "VTI.US", "VXUS.US"],
52-
# weights=[0.40, 0.40, 0.20],
53-
# rebalancing_period="year",
54-
# )
55-
# print(rf3.recovery_period)
36+
al = ok.AssetList(['DJI.INDX',
37+
'BND.US'
38+
])
39+
al.get_rolling_risk_annual(window=12*20).plot()
40+
41+
plt.show()
42+

0 commit comments

Comments
 (0)