optimize_portfolio_tool
Optimize asset allocation to achieve financial goals by maximizing returns, minimizing risk, or balancing portfolios using customizable constraints and advanced solvers.
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 | ||
budget | No | ||
max_allocation | No | ||
min_allocation | No | ||
objective | No | maximize_return | |
risk_tolerance | No | ||
sector_constraints | No | ||
solver_name | No | CBC | |
time_limit_seconds | No |
Input Schema (JSON Schema)
{
"properties": {
"assets": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Assets",
"type": "array"
},
"budget": {
"default": 1,
"title": "Budget",
"type": "number"
},
"max_allocation": {
"default": 1,
"title": "Max Allocation",
"type": "number"
},
"min_allocation": {
"default": 0,
"title": "Min Allocation",
"type": "number"
},
"objective": {
"default": "maximize_return",
"title": "Objective",
"type": "string"
},
"risk_tolerance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Risk Tolerance"
},
"sector_constraints": {
"anyOf": [
{
"additionalProperties": {
"type": "number"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Sector Constraints"
},
"solver_name": {
"default": "CBC",
"title": "Solver Name",
"type": "string"
},
"time_limit_seconds": {
"default": 30,
"title": "Time Limit Seconds",
"type": "number"
}
},
"required": [
"assets"
],
"type": "object"
}