tv_place_order
Place a paper TradingView order with mandatory stop-loss and optional take-profit, sized from risk/stop distance. Dry-run validates and returns pre-order before sending.
Instructions
MUTATES the connected TradingView broker: place an order with a mandatory stop loss and optional take profit through the in-page broker adapter. PAPER ONLY - refuses unless the broker is TradingView Paper Trading on a demo account. Gate (configurable): risk <= 50 USD, max 2 open positions, one position per symbol, denied symbols refused. qty is sized from risk_usd / stop distance unless qty is given. Market orders size off the chart price of the active layout (set the chart to the symbol) or entry_price. dry_run=true returns the exact pre-order and sends nothing; use it first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sl | Yes | stop-loss price (required) | |
| tp | No | take-profit price | |
| qty | No | explicit contract qty; the implied risk must still pass the gate | |
| side | Yes | ||
| type | No | default market | |
| layout | No | chart layout id or index; default active | |
| reason | No | short note for the log | |
| symbol | Yes | BYBIT:ETHUSDT.P (bare ETHUSDT is expanded to BYBIT:ETHUSDT.P) | |
| dry_run | No | true = validate, size and return the pre-order without sending it | |
| risk_usd | No | USD at risk to the stop; sizes qty. Max 50 | |
| stop_price | No | required for type=stop (stop-entry trigger) | |
| entry_price | No | market only: reference price for sizing when the chart is on another symbol | |
| limit_price | No | required for type=limit | |
| 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) |