Skip to content

Issue with build_portfolio #136

Description

@val-pan

Running basic example:

from finquant.portfolio import build_portfolio
names = ['GOOG', 'AMZN', 'MCD', 'DIS']
pf = build_portfolio(names=names, data_api="yfinance")
pf.properties()

Produces NaNs for all stocks except for the first in the list:

Stocks: AMZN, DIS, GOOG, MCD
Time window/frequency: 252
Risk free rate: 0.005
Portfolio Expected Return: 0.075
Portfolio Volatility: nan
Portfolio Downside Risk: nan
Portfolio Value at Risk: nan
Confidence level of Value at Risk: 95.00 %
Portfolio Sharpe Ratio: nan
Portfolio Sortino Ratio: nan

Skewness:
AMZN DIS GOOG MCD
0 0.987787 NaN NaN NaN

Kurtosis:
AMZN DIS GOOG MCD
0 -0.463871 NaN NaN NaN

Information:
Allocation Name
0 0.25 AMZN
1 0.25 DIS
2 0.25 GOOG
3 0.25 MCD

I tried

pf = build_portfolio(data=data), where I feed my own data, but the same behaviour is observed.

Similarlly
pf.returns.daily_returns() gives NaNs for all but the first column

finquant.returns.daily_returns(data) produces correct returns

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions