Skip to main content
Glama

QuantConnect MCP Server

sparse_optimization

Optimize portfolio weights using sparse optimization with Huber Downward Risk minimization. Input portfolio symbols, benchmark, and date range to generate weighted allocations.

Instructions

Perform sparse optimization algorithm with Huber Downward Risk minimization. Args: portfolio_symbols: List of symbols for the portfolio benchmark_symbol: Benchmark symbol to track start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format max_iterations: Maximum iterations for optimization tolerance: Convergence tolerance max_weight: Maximum weight per asset penalty_param: Penalty parameter (p) huber_param: Huber statistics M-value lambda_param: Penalty weight (l) instance_name: QuantBook instance name Returns: Dictionary containing optimized portfolio weights and performance

Input Schema

NameRequiredDescriptionDefault
benchmark_symbolYes
end_dateYes
huber_paramNo
instance_nameNodefault
lambda_paramNo
max_iterationsNo
max_weightNo
penalty_paramNo
portfolio_symbolsYes
start_dateYes
toleranceNo

Input Schema (JSON Schema)

{ "properties": { "benchmark_symbol": { "title": "Benchmark Symbol", "type": "string" }, "end_date": { "title": "End Date", "type": "string" }, "huber_param": { "default": 0.0001, "title": "Huber Param", "type": "number" }, "instance_name": { "default": "default", "title": "Instance Name", "type": "string" }, "lambda_param": { "default": 0.01, "title": "Lambda Param", "type": "number" }, "max_iterations": { "default": 20, "title": "Max Iterations", "type": "integer" }, "max_weight": { "default": 0.1, "title": "Max Weight", "type": "number" }, "penalty_param": { "default": 0.5, "title": "Penalty Param", "type": "number" }, "portfolio_symbols": { "items": { "type": "string" }, "title": "Portfolio Symbols", "type": "array" }, "start_date": { "title": "Start Date", "type": "string" }, "tolerance": { "default": 0.001, "title": "Tolerance", "type": "number" } }, "required": [ "portfolio_symbols", "benchmark_symbol", "start_date", "end_date" ], "type": "object" }

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/taylorwilsdon/quantconnect-mcp'

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