Skip to main content
Glama
GlynnCarson

tradingview-mcp

by GlynnCarson

bracket_backtest

Read-only

Backtest long and short trading strategies on Binance with ATR-based bracket exits, intrabar execution, and realistic fee and slippage costs.

Instructions

Backtest scalp/day/swing strategies (long AND short) on Binance 1m-1d klines.

Unlike backtest_strategy (Yahoo, 1h/1d, long-only), this simulates real execution: ATR-bracket exits (stop / take-profit / time-stop) checked intrabar against high/low, conservative stop-first fills, and per-side fee + slippage so the round-trip cost hurdle is explicit.

Args: symbol: Binance pair, e.g. BTCUSDT, ETHUSDT, SOLUSDT strategy: squeeze_breakout (Bollinger squeeze → band-break entry) | ema_momentum (EMA 9/21 cross gated by EMA200 side) interval: 1m | 3m | 5m | 15m | 30m | 1h | 4h | 1d (candle size) days: History window, 1-730. Suggested: 5m→14, 15m→30, 1h→90-365, 4h→365-730, 1d→730. (Capped at 30k candles total.) direction: both | long | short rr: Reward:risk ratio for the take-profit bracket (default 1.5) atr_mult: Stop distance in ATR(14) multiples (default 1.0) max_hold_bars: Time-stop — force exit after this many bars (default 60) fee_pct: Fee % per side (default 0.05 = Binance USDT-M futures taker; use 0.02 for maker, 0.1 for spot taker) slippage_pct: Slippage % per side (default 0.02) initial_capital: Starting capital in USD (default $10,000) include_trade_log: Include every trade with direction/exit_reason (default False) regime_filter: Gate signals by higher-timeframe trend — longs only in anchor uptrend, shorts only in downtrend, flat in chop regime_anchor: Symbol whose trend gates trades (default BTCUSDT — the market leader; "self" = the traded pair itself) regime_interval: Anchor timeframe for the regime read (default 4h)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rrNo
daysNo
symbolYes
fee_pctNo
atr_multNo
intervalNo1h
strategyNosqueeze_breakout
directionNoboth
slippage_pctNo
max_hold_barsNo
regime_anchorNoBTCUSDT
regime_filterNo
initial_capitalNo
regime_intervalNo4h
include_trade_logNo
Behavior5/5

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

Describes simulation details beyond annotations: ATR-bracket exits, intra-bar high/low checks, conservative stop-first fills, per-side fee+slippage. Annotations (readOnlyHint, destructiveHint) are consistent; no contradiction.

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

Conciseness4/5

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

Well-structured: one-line summary, comparison, execution detail, then detailed Args. Slightly verbose but appropriate given complexity. Every sentence adds value.

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

Completeness5/5

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

Covers all parameters and behavioral details. Explains regime filtering, trade log, and execution model. No output schema but description sufficiently informs about return. Complete for a complex backtesting tool.

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

Parameters5/5

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

Schema has 0% description coverage; the description fully documents all 15 parameters with explanations, defaults, and usage suggestions (e.g., days window tips). Adds critical meaning beyond what schema provides.

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?

Description clearly states it backtests scalp/day/swing strategies on Binance 1m-1d klines (long and short). Explicitly distinguishes from sibling backtest_strategy (Yahoo, 1h/1d, long-only).

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?

Provides explicit alternative (backtest_strategy) for different use cases. Gives parameter suggestions (e.g., interval-day combos). Lacks explicit 'when not to use' but offers sufficient context for decision.

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/GlynnCarson/tradingview-mcp'

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