optimize_portfolio_tool
Optimize portfolio allocation to maximize return or minimize risk. Provide assets with expected return, risk, and sector, then set objective, budget, risk tolerance, sector constraints, and solver to compute optimal weights.
Instructions
Optimize portfolio allocation to maximize return or minimize risk.
Args:
assets: List of asset dictionaries with expected return, risk, and sector
objective: Optimization objective ("maximize_return", "minimize_risk", "maximize_sharpe", "risk_parity")
budget: Total budget to allocate (default: 1.0)
risk_tolerance: Maximum acceptable portfolio risk (optional)
sector_constraints: Maximum allocation per sector (optional)
min_allocation: Minimum allocation per asset (default: 0.0)
max_allocation: Maximum allocation per asset (default: 1.0)
solver_name: Solver to use ("CBC", "GLPK", "GUROBI", "CPLEX")
time_limit_seconds: Maximum solving time in seconds (default: 30.0)
Returns:
Optimization result with optimal portfolio allocation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assets | Yes | ||
| objective | No | maximize_return | |
| budget | No | ||
| risk_tolerance | No | ||
| sector_constraints | No | ||
| min_allocation | No | ||
| max_allocation | No | ||
| solver_name | No | CBC | |
| time_limit_seconds | No |