Webhooks
Alerts & alert webhooks
Price and drawing alerts run in the browser; react to them in code or send them as webhooks.
<FxChart
onAlert={(alert, price, time) => {
// alert = { id, symbol, condition, price, message, source?, drawing? }
toast(`${alert.symbol} hit ${price}`);
}}
/>In the alert dialog, tick Send a webhook and write a JSON message — placeholders {{ticker}} {{close}} {{level}} {{condition}} {{time}} are filled in. A non-JSON message is sent as { event: "alert", ticker, close, level, condition, time, message }. Alert webhooks also go through onWebhook.
{"action":"buy","symbol":"{{ticker}}","price":{{close}}}Alerts and webhooks run while the page is open. For 24/7 alerts, run the same check on a server with your data source.