Questions › Guides

cTrader: send cBot alerts to a webhook that get retried

Short answer: Use the free HoldAlarmsNotifier cBot (holdalarms-snippets on GitHub). It posts each alert as JSON with cTrader's Http.SendAsync to your HoldAlarms webhook URL. HoldAlarms answers as soon as the alert is queued, then delivers it to your endpoint and retries if it fails (cTrader: network access).

Why alerts get lost

  1. Your endpoint is down or restarting. The cBot gets an error, and unless something tries again your endpoint never sees that alert.
  2. It runs in cTrader Cloud. cTrader sends nothing there and answers 403 (cTrader: Http.Send).
  3. Nobody notices. A failed request only shows in the cBot log.

Set it up with HoldAlarms

  1. Start a trial and copy the webhook URL from your dashboard.
  2. Add your own endpoint as a destination in HoldAlarms.
  3. In cTrader Algo, create a cBot from ctrader/HoldAlarmsNotifier.cs, build it, paste the URL into Webhook URL and start it.
  4. Check Recent alerts on your dashboard for the test alert.

Full reference: Docs: cTrader setup.

What HoldAlarms does

We answer cTrader with HTTP 200 once the alert is queued, then deliver it to your endpoint in the background. Your endpoint gets 10 seconds per attempt. If it fails, we retry up to 5 times, 2 to 60 seconds apart (permanent errors such as 401 or 403 aren't retried). Retries finish within about 3 minutes, or up to about 6 if your server asks for longer waits with Retry-After. After that the alert is parked in a dead-letter queue and you get an email.

Two honest limits: we add a hop, so HoldAlarms doesn't cut latency; and a delivered alert means your endpoint accepted it, not that your app finished processing it. Starter is €19/mo and Ops €49/mo.

Questions

Does the cBot need full access rights?

No. AccessRights.None is enough for web requests in cTrader.

Does it work in cTrader Cloud?

No. cTrader does not send web requests from cTrader Cloud and answers 403. Run the cBot in cTrader Desktop or the cTrader CLI.

Will a backtest send alerts?

Not with our cBot. cTrader sends real web requests during backtests, so the cBot only sends when it runs live.

Does HoldAlarms reduce latency?

No. HoldAlarms adds a hop, so each alert reaches your endpoint slightly later than it would directly. What it gives you is an answer to the cBot as soon as the alert is queued, and 5 retries to your endpoint.

More guides

HoldAlarms is not affiliated with Spotware. cTrader is a trademark of its owner.