alert
Build everything TradingView's create_alert(webhook, message, expiration, resolution) needs, in one call: fuses command (the message) and hooks (the webhook URL for hook_id), and fills in the expiration (default 1 year out -- TradingView itself defaults to only 30 days, which silently stops the alert) and resolution (default "1") TradingView also needs. The order is validated against the exchange(s) hook_id is actually linked to and rejected if it could never fire there. Returns warnings you should read, including never putting the hook's key in the message field and a fan-out warning when the hook links more than one exchange. Pass the alert field instead of the structured fields to use raw webhook command text with any key a webhook accepts. Dry-run by default like command; set live:true to build a command that trades for real once the alert fires. For any other sender, command + hooks give the same message and webhook URL; expiration and resolution are TradingView settings only. Requires your Autoview account token.
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": {
"hook_id": "<hook_id>"
},
"name": "alert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| live | No | false (default) = build a dry-run preview command (appends d=1); true = build a command that places a real order when the alert fires | |
| side | No | order direction; required unless action is set, where it is an optional buy/sell filter for cancel/close (omit for flat) | |
| type | No | order type; defaults to limit at the ticker (t=limit with no price, same as a plain alert). An attached bracket needs type market explicitly. | |
| unit | No | "currency" treats quantity as a CURRENCY amount to convert to units at the resolved price (u=currency) — e.g. quantity:10 with unit:"currency" on BTC/USD buys $10 of BTC instead of 10 BTC. Only meaningful with a fixed (non-percent) quantity. | |
| alert | No | the raw command text a webhook body carries, e.g. s=BTCUSD b=buy q=0.01 fp=60000 ef=any tif=gtc; any key a webhook accepts works here, it is checked by the engine's parser and becomes the message as-is (with d=1 leading each line unless live is true). Do not combine with the structured order fields. | |
| price | No | absolute limit price; required for an explicit limit, post_only, ioc, fok, and stop_limit (omit type and price for a limit at the ticker) | |
| token | No | your Autoview account token — an av_mcp_ personal access token, generate one at /account/tokens/ on the Autoview site. Omit this if your MCP client already sends it as an `Authorization: Bearer` header (Claude Code, Cursor, and most non-browser clients do this automatically once configured). | |
| action | No | manage EXISTING orders/positions on symbol instead of placing a new one: cancel = cancel open orders, close = close open positions, flat = cancel every order AND close every position (Tradovate only). When set, side (if given) is an optional buy/sell filter (not applicable to flat), and quantity/type/price/trigger/brackets/unit are ignored. | |
| symbol | No | the instrument symbol, e.g. EUR_USD, XBTUSD, BTC_USD. Required unless alert is set | |
| hook_id | Yes | the hook whose URL becomes the alert's webhook (see the `hooks` tool) | |
| trigger | No | absolute trigger (stop) price; required for stop and stop_limit | |
| exchange | No | optional — any exchange id known to Autoview (see `catalog`); a bracket is refused if that exchange lists its params as unsupported. Must be one of the exchanges hook_id is linked to (otherwise the alert is rejected); omit to validate against every exchange the hook is linked to | |
| priceRef | No | reference price for percent sizing and brackets | |
| quantity | No | order size: a positive number (contracts/units), or a percent-of-balance string like "50%" (1-100%). Required unless action is set. | |
| stopLoss | No | attached bracket stop-loss distance from the fill: points (10) or a percent string such as 3%; a sign, if given, must point the right way); pairs with takeProfit or a trail leg | |
| trailStop | No | auto-trail stop distance in points; requires trailActivate | |
| expiration | No | ISO 8601 timestamp for TradingView's alert expiration; defaults to 1 year from now | |
| resolution | No | chart timeframe TradingView's create_alert needs; defaults to "1" (1 minute) | |
| takeProfit | No | attached bracket take-profit distance from the fill: points (20) or a percent string such as 5%; pairs with stopLoss or a trail leg | |
| trailActivate | No | points of profit before the trail starts; required whenever trailStop is set | |
| trailFrequency | No | how often the trailing stop re-checks price; defaults to 1 if omitted | |
| sizeAgainstEquity | No | for a percent quantity, size against equity instead of available balance (y=equity) |