Skip to main content
Glama

monte_carlo_random_portfolio

Read-onlyIdempotent

Compares your strategy against thousands of random portfolios to determine if returns are from skill or luck. Returns percentile and p-value for your total return, Sharpe, or max drawdown.

Instructions

蒙地卡羅隨機選股 benchmark — 從指定 universe 隨機抽 N 檔等權重持有 K 次,得到 random benchmark 分布;如帶入用戶策略指標,回傳該策略落點百分位 + p-value。回答「我的策略真有 alpha 還是運氣好」。低頻交易者特別有效(單條 path 不穩 → MC 把 single-path 變 distribution)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketNo市場 TW 或 US,預設 TW
startDateYes回測起日 YYYY-MM-DD
endDateYes回測迄日 YYYY-MM-DD
nPicksNo隨機抽幾檔(2-50,預設 10)
nSimulationsNo次數(100-10000,預設 1000;建議 ≥ 1000)
poolNouniverse pool:all(預設)/ top50_100(v2)
strategyTotalReturnNo用戶策略總報酬率 %(用來算百分位;可選)
strategySharpeNo用戶策略 Sharpe(可選)
strategyMaxDDNo用戶策略最大回撤 %(正值;可選)
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate readOnly, non-destructive, idempotent. Description adds that the tool generates a distribution and returns percentile/p-value if strategy metrics are provided, and explains why it's useful for low-frequency traders. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single paragraph that conveys core purpose, method, and use case. However, it is somewhat dense and could be more concise. Not as front-loaded as ideal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description explains what the tool does, how it works, and provides a practical use case. Although there is no output schema, the description implies the return includes distribution and optionally percentile/p-value, which is fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions. The description adds context for optional strategy parameters (used to compute percentile), but does not significantly enhance meaning beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs Monte Carlo random stock picking from a universe to generate a random benchmark distribution, and can return a strategy's percentile and p-value. It differentiates from siblings like monte_carlo_factor_mining by focusing on benchmarking random portfolios.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the tool is used to answer whether a strategy has alpha or is lucky, and notes it is particularly effective for low-frequency traders. It provides context but does not explicitly list when not to use it or alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/kevinlin49361128-stack/stock-analyzer-mcp'

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