apply_optimization
Optimizes investment portfolios by applying selected methods to update asset weights, improving metrics like Sharpe ratio or targeting specific returns and volatility.
Instructions
Apply optimization and update portfolio weights.
Optimizes the portfolio using the specified method and updates the stored portfolio with the new optimal weights.
Args: name: The portfolio name. method: Optimization method (same as optimize_portfolio). target_return: Target return for "efficient_return" method. target_volatility: Target volatility for "efficient_volatility" method.
Returns: Updated portfolio information with new weights and metrics.
Example:
result = apply_optimization(name="tech_stocks", method="max_sharpe")
print(f"New Sharpe: {result['new_metrics']['sharpe_ratio']:.2f}")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| method | No | max_sharpe | |
| target_return | No | ||
| target_volatility | No |