Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
methodNomax_sharpe
target_returnNo
target_volatilityNo

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/l4b4r4b4b4/portfolio-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server