Skip to main content
Glama
kevynf

AKBridge MCP Server

by kevynf

volatility_yz_rv

Read-onlyIdempotent

Estimates Yang-Zhang realized volatility using high, low, open, and close prices. Provides a robust volatility measure accounting for overnight gaps and intraday price fluctuations.

Instructions

波动率-已实现波动率-Yang-Zhang 已实现波动率(Yang-Zhang Realized Volatility) https://github.com/hugogobato/Yang-Zhang-s-Realized-Volatility-Automated-Estimation-in-Python 论文地址:https://www.jstor.org/stable/10.1086/209650 基于以下公式计算: RV^2 = Vo + k*Vc + (1-k)*Vrs 其中:

  • Vo: 隔夜波动率, Vo = 1/(n-1)*sum(Oi-Obar)^2 Oi为标准化开盘价, Obar为标准化开盘价均值

  • Vc: 收盘波动率, Vc = 1/(n-1)*sum(ci-Cbar)^2 ci为标准化收盘价, Cbar为标准化收盘价均值

  • k: 权重系数, k = 0.34/(1.34+(n+1)/(n-1)) n为样本数量

  • Vrs: Rogers-Satchell波动率代理, Vrs = ui(ui-ci)+di(di-ci) ui = ln(Hi/Oi), ci = ln(Ci/Oi), di = ln(Li/Oi), oi = ln(Oi/Ci-1) Hi/Li/Ci/Oi分别为最高价/最低价/收盘价/开盘价

:param data: 包含 OHLC(开高低收) 价格的 pandas.DataFrame :type data: pandas.DataFrame :return: 包含 Yang-Zhang 实现波动率的 pandas.DataFrame :rtype: pandas.DataFrame

要求输入数据包含以下列:

  • Open: 开盘价

  • High: 最高价

  • Low: 最低价

  • Close: 收盘价

yang_zhang_rv formula is give as:

RV^2 = Vo + k*Vc + (1-k)*Vrs

where Vo = 1/(n-1)*sum(Oi-Obar)^2

with oi = normalized opening price at time t and Obar = mean of normalized opening prices

Vc = = 1/(n-1)*sum(ci-Cbar)^2

with ci = normalized close price at time t and Cbar = mean of normalized close prices

k = 0.34/(1.34+(n+1)/(n-1))

with n = total number of days or time periods considered

Vrs (Rogers & Satchell RV proxy) = ui(ui-ci)+di(di-ci)

with ui = ln(Hi/Oi), ci = ln(Ci/Oi), di=(Li/Oi), oi = ln(Oi/Ci-1)

where Hi = high price at time t and Li = low price at time t

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
Behavior3/5

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

Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, so the safety profile is covered. The description adds the exact formula and required columns, which is useful behavioral context. However, it does not disclose edge cases, error conditions, or the exact output format beyond returning a DataFrame, which is a gap.

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

Conciseness2/5

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

The description is verbose and repetitive, with the formula presented in both Chinese and English comments, plus external links and a paper reference. This adds noise and reduces readability. The essential information could be conveyed in two or three concise sentences, making the current length unjustified.

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

Completeness2/5

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

The description includes the formula, input requirements, and return type, but it does not specify the output column name, how to pass data in the JSON format expected by the schema, or how missing/invalid data is handled. The formula itself contains a minor discrepancy (di listed as either ln(Li/Oi) or Li/Oi) that could confuse the agent. With no output schema, these omissions make the description incomplete.

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

Parameters2/5

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

The schema has zero descriptions for the 'data' parameter, and the description only says it should be a pandas.DataFrame with OHLC columns. The schema expects an array or object, but the description does not explain this mismatch or how to structure the data as JSON. It lists required columns, providing some value, but fails to bridge the DataFrame-to-JSON gap.

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 identifies the tool as calculating Yang-Zhang Realized Volatility from OHLC data, with a specific verb ('计算') and resource. It includes the full formula and differentiates from sibling tools that fetch data rather than compute. The title and description align, making the purpose unambiguous.

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

Usage Guidelines3/5

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

The description implies usage as a calculation tool that requires OHLC data, but it does not explicitly state when to use this tool versus alternatives like rv_from_futures_zh_minute_sina or rv_from_stock_zh_a_hist_min_em. It provides no when-to-use or when-not-to-use guidance, so the agent must infer based on context.

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/kevynf/akbridge'

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