Skip to main content
Glama
tedorigawa001

TradingView-MCP

run_strategy_regime_analysis

Evaluate a saved Pine strategy's behavior across market regimes by running it temporarily, joining trades to regime bars, and reporting PF, expectancy, win rate, drawdown, and coverage.

Instructions

Run one exact saved Pine Strategy temporarily, collect its complete immutable trade ledger, and join each closed trade to the latest market-regime bar whose nominal close was available by entry time. Returns PF, expectancy, win rate, closed-trade drawdown, run-up/drawdown, and coverage by directional, volatility, and combined regime. Dry-run by default; confirm=true is required. The strategy is removed and the original chart fingerprint is verified. It never ranks regimes, changes the saved Pine source, or places orders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoMost recent loaded bars used for regime evidence. Default: 20000
inputsNo
confirmNoMust be true to add the strategy temporarily and run the analysis. Default: false
pine_idYes
sessionsNoOptional DST-aware session windows used for entry-time grouping
atr_lookbackNo
pine_versionYes
trend_lookbackNo
event_proximityNoOptional scheduled-event entry-time groups; caller supplies canonical UTC timestamps
expected_symbolYes
correlation_regimeNoOptional rolling correlation groups from a second bound chart with the same timeframe
expected_timeframeYes
max_regime_age_barsNoMaximum age of the prior closed regime evidence. Default: 3 bars
low_volatility_ratioNo
minimum_group_tradesNoJoined trades required for an individual regime group. Default: 30
session_match_policyNoSession overlap handling. Default: all_matches_non_exclusive; exclusive uses input order
high_volatility_ratioNo
minimum_coverage_ratioNoEligible closed trades that must join to a regime. Default: 0.8
minimum_classified_barsNoRegime observations required before evaluation is complete. Default: 100
range_efficiency_thresholdNo
trend_efficiency_thresholdNo
volatility_baseline_lookbackNo
directional_move_atr_thresholdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.10

TDQS

A4.2/5.0
Behavior5/5

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

No annotations exist, so the description carries the entire burden of behavioral disclosure. It does this exceptionally well: temporary strategy addition, immutable ledger, dry-run by default, mandatory confirm, strategy removal, chart fingerprint verification, and explicit no-op guarantees (no ranking, no source changes, no orders).

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 yet compact. Each sentence delivers distinct value: the action and ledger, the returned metrics, the dry-run/confirm requirement, the cleanup/fingerprint verification, and the negative guarantees. No wasted words.

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

Completeness3/5

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

With 23 parameters, no annotations, and no output schema, the description provides a strong high-level overview and return metrics, but leaves many configuration semantics unexplored. The schema covers some parameters, but the overall context is not fully sufficient for reliably invoking such a complex tool with correct optional parameters.

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?

Schema description coverage is only 43%, so the description should compensate, but it only clarifies the confirm parameter ('confirm=true is required') and the generic regime-join concept. Most parameters (atr_lookback, trend_lookback, event_proximity, correlation_regime, thresholds, lookbacks) are not explained in the description and some lack schema descriptions.

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 ('Run one exact saved Pine Strategy temporarily'), the resource, and the analysis pipeline (join trades to regime bars). It also distinguishes itself by explicitly saying it 'never ranks regimes', which separates it from siblings like run_strategy_regime_matrix.

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 clearly states when to use: for analyzing one saved strategy's trades against regimes. It provides key preconditions like 'Dry-run by default; confirm=true is required' and exclusions ('never ranks regimes... or places orders'). However, it does not explicitly name alternative tools for different use cases, 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