Skip to main content
Glama
tedorigawa001

TradingView-MCP

compute_lead_lag_relationships

See whether a reference market leads your primary chart by scanning return correlations across symmetric lags. Get per-lag interval and stability for descriptive evidence.

Instructions

Scan return correlation between two explicitly bound layout charts across a symmetric range of lags, so a caller can see whether a reference market leads the primary. Closed bars must share an exact UTC timestamp; missing bars are never forward-filled. The v3 default scales each return by its own series' prior-20-return RMS without using the current return. Every scanned lag is returned with its own interval and per-fold stability, and no best lag is selected. Shared clustered-volatility calibration still exceeds nominal alpha, so candidate eligibility and journal promotion remain disabled. Descriptive evidence only, never a trading signal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
foldsNo
journalNoRecord this scan as evidence. Only tradable positive lags are stored; a scan can never be adopted, so decision must be rejected or inconclusive.
max_lag_barsNoScan every lag from -max_lag_bars to +max_lag_bars. Default: 10
alignment_modeNoDefault exact_utc joins only identical bar timestamps. The resampling mode temporarily reads both charts at closed 60-minute bars and rebuilds a common UTC grid at expected_timeframe; use it only when vendor-anchored higher-timeframe bars cannot align exactly.
confidence_levelNo
expected_timeframeYes
primary_chart_indexYes
configuration_trialsNoTotal related scans inspected so far, including this one. Applied with all scanned lags as the Bonferroni family. Default: 1
minimum_observationsNoLags with fewer paired returns are reported as insufficient. Default: 30
reference_chart_indexYes
return_standardizationNoDefault causal_prior_20_rms uses only each return's prior 20 returns for scale. none reproduces the invalidated raw-return v2 contract.
expected_primary_symbolYes
expected_reference_symbolYes
empirical_null_calibrationNoRun the fixed 1,000-replication circular-shift empirical-null calibration on this exact pair. Required for the statistical gate; public candidate eligibility remains disabled pending shared-volatility calibration. Default: false

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.10

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so thoroughly: exact UTC timestamp matching, no forward-filling, v3 causal RMS scaling, per-lag interval/stability output, no best-lag selection, disabled eligibility/journal promotion due to calibration, and descriptive-only status. This goes well beyond the tool name and schema.

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

Conciseness5/5

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

The description is dense but every sentence carries distinct information and the primary purpose is front-loaded. There is no repetition of schema fields or filler; the technical constraints are ordered logically from alignment to scaling to output to calibration implications.

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?

For a 15-parameter tool with no output schema and no annotations, the description covers a remarkable amount: alignment behavior, defaults, output characteristics, calibration restrictions, and evidence status. It still lacks explicit guidance on the return payload shape beyond interval/stability and on the semantics of some parameters like confidence_level, so it is not fully 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 only 47% and the description compensates for some parameters (symmetric lag range maps to max_lag_bars, prior-20 RMS scaling maps to return_standardization, exact UTC alignment maps to alignment_mode, per-fold stability maps to folds). However, several parameters such as count, confidence_level, folds structure, and the required expected_* fields receive no semantic explanation in either the schema or the description.

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 states a specific action ('Scan return correlation') on a specific resource ('two explicitly bound layout charts') with a clear investigative goal (whether reference market leads primary). It also distinguishes itself from audit siblings by emphasizing 'Descriptive evidence only, never a trading signal' and by noting no best lag is selected.

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?

It gives clear intended-use context: use this to explore lead-lag correlation via symmetric lags, and explicitly warns it is descriptive evidence, not a trading signal. It does not name alternative tools or give explicit when-not-to-use conditions beyond the descriptive-evidence caveat, so it stops short of a 5.

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