okama.Portfolio.weights

property Portfolio.weights

Get or set assets weights in portfolio.

If not defined equal weights are used for each asset.

Weights must be a list (or tuple) of float values.

Returns:
Values for the weights of assets in portfolio.

Examples

>>> x = ok.Portfolio(['SPY.US', 'BND.US'])
>>> x.weights
[0.5, 0.5]