robertmartin8/PyPortfolioOpt

Feature request: extract performance attributes as attributes

Opened this issue · 0 comments

(from email)

I was wondering if there is an easy way you could allow for object calls to ef such that one could retrieve single values as primitive types. Below is current and proposed executions and returns:

CURRENT
Executed ->
ef.portfolio_performance(verbose=True)
Returns ->
Expected annual return: 30.5%
Annual volatility: 22.2%
Sharpe Ratio: 1.28

PROPOSED
Executed ->
print(ef.expect_annual_returns)
print(ef.annual_volatility)
print(ef.sharpe_ratio)
Returns ->
.305
.222
1.28