TradingView-only: strategy backtest
stock_backtestBacktest a trading strategy on any ticker or coin using TradingView and Yahoo price history, then compare results metric by metric to show which data feed produced the numbers.
Instructions
Backtest a strategy on a symbol, using each provider's own history.
The history is fetched from TradingView's chart feed and from Yahoo's chart API independently, and the strategy is run on each. The two results are compared metric by metric, if the OHLCV bars differ materially, the backtest is only as trustworthy as the feed it came from, and the response says which one produced the numbers shown.
Args:
symbol: Ticker or coin (any instrument either provider quotes).
strategy: One of rsi, bollinger, macd, ema_cross,
supertrend, donchian, rsi_pullback, keltner_breakout,
triple_ema.
period: 6mo, 1y, 2y, 5y, …
initial_capital: Starting cash.
interval: 1d or 1h.
include_trade_log: Include the per-trade log.
include_equity_curve: Include the equity curve.
Returns:
Envelope whose data_provider is ALL when both feeds answered,
TRADINGVIEW/YAHOO when only one did (single-source), or NONE.
comparisons holds the metric-by-metric agreement.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"symbol": "<symbol>",
"strategy": "<strategy>"
},
"name": "stock_backtest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | 1y | |
| symbol | Yes | ||
| interval | No | 1d | |
| strategy | Yes | ||
| initial_capital | No | ||
| include_trade_log | No | ||
| include_equity_curve | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||