openseries.constrain_optimized_portfolios

openseries.constrain_optimized_portfolios(data, serie, portfolioname='Current Portfolio', simulations=10000, curve_points=200, bounds=None, minimize_method='SLSQP')[source]

Constrain optimized portfolios to those that improve on the current one.

Parameters:
  • data (OpenFrame) – Portfolio data.

  • serie (OpenTimeSeries) – A timeseries representing the current portfolio.

  • portfolioname (str) – Name of the portfolio. Defaults to “Current Portfolio”.

  • simulations (int) – Number of possible portfolios to simulate. Defaults to 10000.

  • curve_points (int) – Number of optimal portfolios on the efficient frontier. Defaults to 200.

  • bounds (tuple[tuple[float, float], ...] | None) – The range of minimum and maximum allowed allocations for each asset.

  • minimize_method (LiteralMinimizeMethods) – The method passed into the scipy.minimize function. Defaults to SLSQP.

Returns:

The constrained optimal portfolio data.

Return type:

tuple[OpenFrame, OpenTimeSeries, OpenFrame, OpenTimeSeries]