tv_close_position
Closes an open TradingView paper trading position by symbol or position ID and returns both the closed position and remaining open positions.
Instructions
MUTATES the connected TradingView broker: close an open position by symbol or position id (market close via the broker adapter). PAPER ONLY. Returns the position that was closed and the remaining open positions.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "tv_close_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layout | No | chart layout id or index; default active | |
| symbol | No | symbol of the position to close, e.g. BYBIT:ETHUSDT.P | |
| position_id | No | position id from tv_trading_status (wins over symbol) | |
| expect_layout | No | layout id the tab is expected to show right now; the call refuses if it differs (a tab keeps its target id when the user opens another layout in it) |