Documentation

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.

Neural scoringa 0–100 confidence score from a scoring model.
Volume & order-flowvolume spikes and aggressive-trade imbalance (VPIN).
Market regimetrend vs range vs mean-reversion classification.
Funding & liquidationfunding-rate dynamics and liquidation clusters.
Stop-loss mappingavoids placing stops inside known liquidity clusters.
Your hard rulesdirection, session hours, position and drawdown limits.

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.

Daily loss limitWhen your realised loss for the day reaches your configured limit — a percentage of balance or a fixed amount — AlgoVesta enters Safe Mode and stops opening new trades until the next day.
Drawdown-based sizingAs account drawdown grows, position size is automatically reduced in stages (cautious → defensive → survival), so a losing streak shrinks your exposure instead of compounding it.

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.

# POST https://api.algovesta.com/webhook/<your-token> { "symbol": "BTCUSDT", "side": "buy", "price": 64250.0, "stop_loss": 63800.0, "take_profit": 65100.0 }
FieldRequiredDescription
symbolYesExchange trading pair, e.g. BTCUSDT.
side / actionYesOrder direction: buy or sell.
priceOptionalEntry reference price; omit for market entry.
stop_lossOptionalStop-loss price. Recommended on every signal.
take_profitOptionalTake-profit price. Multiple targets configurable in-app.
marketOptionalTarget market: crypto (default) or forex. Sent to MetaTrader 5 when set to forex. Never inferred from the symbol.
lotsOptionalForex only — position size in lots. Leave out to use your configured lot/risk mode.
leverageOptionalCrypto only — your exchange's limit for that symbol applies.
amount_usdOptionalCrypto only — margin, not notional. Notional = margin × leverage.
risk_percentOptionalCrypto only — % of balance to risk (0.1–50).
quantityOptionalCrypto only — exact contract quantity. qty, size and contracts are accepted as aliases.
take_profitsOptionalMultiple targets: [{"price":…, "close_pct":…}]. tp1tp5 with tpN_close also work.
trailingOptional{"trigger_pct":…, "distance_pct":…} — trailing stop.
breakevenOptionaltrue 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.

{ "symbol": "BTCUSDT", "action": "close" }

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.

{ "symbol": "{{ticker}}", "action": "{{strategy.order.action}}", "market_position": "{{strategy.market_position}}", "prev_market_position": "{{strategy.prev_market_position}}", "position_size": "{{strategy.position_size}}" }
Position after the fillWhat AlgoVesta does
flat (or position_size = 0)Closes the position. No reverse order is opened.
Opposite of the previous stateReversal — closes first, then opens the new direction. If the close fails, nothing is opened.
Same direction as beforeTreated 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.

No-code builder
Don't write JSON by hand — build it visually

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

Which channels can trigger a trade on AlgoVesta?

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.

Is the webhook JSON format required for TradingView?

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.

Does the risk engine apply to MCP and Telegram orders too?

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.

Where do I find the full MCP tool reference?

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.

Can I test without real money?

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.