Risk Engine & Webhook Reference
How AlgoVesta verifies every signal before execution, and the exact JSON payload to send from TradingView or any webhook source. Field names are literal — copy them as-is.
AlgoVesta executes trades from three trigger channels: an MCP server for AI assistants, Telegram signals, and TradingView webhooks. Whichever channel fires, the same server-side risk engine verifies the order before it reaches your exchange or MetaTrader 5 account. This page is the technical reference hub for all three.
Three ways to trigger a trade
Every channel ends in the same execution path: verification, sizing, order, then stop-loss and take-profit placed on the venue itself. Pick the channel that matches how you already work.
MCP server for AI assistants
Connect Claude, ChatGPT, Cursor or any MCP-capable client to twenty native trading tools over one authenticated link. Every connection starts on a $5,000 paper balance, and live keys are created separately with a second factor. Authentication is either OAuth 2.1 with PKCE (S256) or a per-user secret link.
Telegram signal channels
Point AlgoVesta at the signal channels you already follow. Messages are parsed into a symbol, direction, entry, stop-loss and targets, then executed on your exchange or forwarded to MetaTrader 5. Signals that cannot be parsed unambiguously are rejected rather than guessed.
TradingView webhooks
Send an alert from any indicator, drawing or Pine strategy to your private webhook URL. The alert body must be valid JSON in the format documented below, and the source of every auto-traded signal is verified before an order is opened.
Risk Engine: how a signal is verified
A signal is never executed blindly. Before any order is placed, it passes a multi-module verification layer that checks it against live market conditions and the limits you set. If a hard rule fails, the signal is rejected — not sized down.
The exact module set and thresholds evolve as the platform is tuned. The principle is constant: your rules and risk limits are always applied before an order reaches your exchange.
Daily loss & drawdown protection
Beyond per-signal checks, two account-level safeguards run continuously.
Webhook payload reference
Send an HTTP POST with a JSON body to your AlgoVesta webhook URL. From TradingView, paste this into the alert message box. Field names must match exactly.
| Field | Required | Description |
|---|---|---|
symbol | Yes | Exchange trading pair, e.g. BTCUSDT. |
side / action | Yes | Order direction: buy or sell. |
price | Optional | Entry reference price; omit for market entry. |
stop_loss | Optional | Stop-loss price. Recommended on every signal. |
take_profit | Optional | Take-profit price. Multiple targets configurable in-app. |
market | Optional | Target market: crypto (default) or forex. Sent to MetaTrader 5 when set to forex. Never inferred from the symbol. |
lots | Optional | Forex only — position size in lots. Leave out to use your configured lot/risk mode. |
leverage | Optional | Crypto only — your exchange's limit for that symbol applies. |
amount_usd | Optional | Crypto only — margin, not notional. Notional = margin × leverage. |
risk_percent | Optional | Crypto only — % of balance to risk (0.1–50). |
quantity | Optional | Crypto only — exact contract quantity. qty, size and contracts are accepted as aliases. |
take_profits | Optional | Multiple targets: [{"price":…, "close_pct":…}]. tp1…tp5 with tpN_close also work. |
trailing | Optional | {"trigger_pct":…, "distance_pct":…} — trailing stop. |
breakeven | Optional | true or {"trigger_pct":…} — move stop to entry once in profit. |
Exchange prefixes are stripped, so BINANCE:BTCUSDT works the same as BTCUSDT. For the direction field, direction and type are accepted as aliases of action, and close is a valid value.
Position size, leverage and per-signal risk can come from your dashboard or from the payload — a value in the payload takes priority. That is why the webhook URL is a secret: add an IP allowlist so AlgoVesta only auto-trades signals whose source it can verify.
Closing a position
Send "action": "close" with the symbol. The whole position on that symbol is closed — partial closes are not supported; if you ask for one, the entire position is closed and the panel says so.
Pine strategy alerts — exits are automatic
If you build the alert from a Pine strategy() with “Order fills only”, do not send action alone: {{strategy.order.action}} returns sell on an exit too, which would open a short instead of closing. Include the position-state fields and AlgoVesta works out entry, exit and reversal for you.
| Position after the fill | What AlgoVesta does |
|---|---|
flat (or position_size = 0) | Closes the position. No reverse order is opened. |
| Opposite of the previous state | Reversal — closes first, then opens the new direction. If the close fails, nothing is opened. |
| Same direction as before | Treated as an entry in that direction. |
The message must be JSON. TradingView sends the alert body as plain text when it isn't valid JSON — its default message (e.g. “BTCUSDT Crossing 1.00”) carries no direction and is rejected. We never guess on ambiguous text; rejecting a signal is safer than opening an order in the wrong direction. Note also that TradingView stops alerts automatically after 15 fire within 3 minutes.
Set direction, take-profit / stop-loss (single or multi-level), leverage, position size, trailing and breakeven with simple toggles. AlgoVesta generates the exact TradingView alert message — copy it and paste it into your alert.
See how the visual builder works → Step-by-step alert setup →Frequently asked questions
Three: the MCP server used by AI assistants, Telegram signal channels, and TradingView webhooks. A trade can also be opened manually from your dashboard. Every channel routes into the same execution path and the same risk checks.
Yes. TradingView sends the alert body as plain text when it is not valid JSON, and its default alert message carries no direction, so it is rejected. Use the payload format documented in the webhook payload reference above, or build it visually and paste the result into your alert.
Yes — the same server-side checks run on every channel. Your risk policy, the stop-loss requirement and your position and drawdown limits are enforced before an order reaches a venue, whether the order came from an AI assistant, a Telegram signal or a TradingView alert. No prompt or message can loosen them.
The MCP developer reference documents all 20 tools, the three scopes, OAuth 2.1 and secret-link authentication, rate limits, error codes and the 16 supported exchanges plus MetaTrader 5.
Yes. Every MCP connection starts on a $5,000 virtual paper balance with real market prices, and TradingView and Telegram automation both have a demo mode that simulates the full signal-to-order flow. Live trading always requires a separate, explicitly created key or connection.