Webhooks and alerts
Any system that can send an HTTP POST can drive Quanify: TradingView alerts, a Python script, or your own server. There is no glue code to write.
Your webhook URL
Creating a strategy gives it a unique URL. Open Webhook Setup on the strategy to copy it. It looks like this:
https://quanify.pro/api/webhooks/<your-token>
The token in that URL is the credential. Anyone holding it can send signals to that strategy, so treat it like a password: do not paste it into a public chart, a screenshot or a shared repository. If you want a second factor, set a webhook password on the strategy and include it in the alert body.
The alert message
Send JSON. The Webhook Setup panel builds the exact message for you, already matching the strategy's settings — if you set a fixed contract size it hard-codes that number, and if you set a webhook password it includes it. Copy it and paste it into your alert.
{
"action": "{{strategy.order.action}}",
"ticker": "{{ticker}}",
"contracts": "{{strategy.order.contracts}}",
"price": "{{strategy.order.price}}",
"market_position": "{{strategy.market_position}}"
}
The double-brace values are TradingView placeholders — TradingView fills them in when the alert fires. If you are sending from your own code, put real values there instead.
| Field | What it does |
|---|---|
action | buy or sell. Required. |
ticker | The instrument. Resolved to the tradeable contract for you, so you do not have to track front-month rollover. |
contracts | The base size, before per-account multipliers are applied. Ignored if the strategy has a fixed contract size set. |
price | The price the alert was generated at. Passed through and used for the recorded signal, so a strategy can build a record even without a broker attached. |
market_position | long, short or flat. This is what lets a flip be told apart from a scale-in. |
password | Only needed if you set a webhook password on the strategy. |
Extra fields are ignored, so you can send whatever else your system already emits without stripping it first. The receiver does not care what content type you send it, which is why a TradingView alert works unmodified.
Setting the alert up in TradingView
- Create an alert on your strategy or indicator.
- Under notifications, enable the webhook and paste the URL from Webhook Setup.
- Paste the JSON from Webhook Setup into the alert's message box.
- Save. Fire a test alert and check the Signal Log on Control Center.
What happens next
- The signal is authenticated and recorded. This happens before routing, so your record stays complete even when nothing ends up trading.
- A fill is only ever acted on once, even if the same one is reported more than once. Duplicate deliveries do not turn into duplicate orders.
- The engine works out which sub-accounts that strategy is routed to and what size each one takes, applying the per-account multiplier.
- Per-account checks run: is the strategy enabled, is the trader armed, is the account muted, and would this signal grow a position when 2+ entries are switched off.
- Surviving orders go to the broker and the outcome of each one is logged per account.
Reading the response
A success response means the signal was accepted and recorded. That includes the case where no account was eligible — for example when every trader for that strategy is powered off, or every account is muted.
This is deliberate. Returning an error there made TradingView mark the alert as failed and eventually throttle it, which costs you real signals later. So the HTTP response is not where you look to find out whether something traded. The Signal Log is.
Keeping the token safe
- Set a webhook password on any strategy that trades a funded account.
- Use a separate strategy, and therefore a separate token, per signal source. Deleting one then does not disturb the others.
- If you think a token has leaked, delete the strategy and create a new one. The new one gets a new token, and you re-point the alert at it.