update_portfolio_weights
Update the weight distribution of assets in a portfolio and recalculate performance metrics such as Sharpe ratio.
Instructions
Update the allocation weights of an existing portfolio.
Changes the weight distribution across assets in a portfolio and recalculates all metrics.
Args: name: The portfolio name. weights: New allocation weights per symbol. Must sum to 1.0.
Returns: Updated portfolio information with new metrics.
Example:
result = update_portfolio_weights(
name="tech_stocks",
weights={"GOOG": 0.5, "AMZN": 0.3, "AAPL": 0.2}
)
print(f"New Sharpe: {result['metrics']['sharpe_ratio']}")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| weights | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||