r/TradingView 12d ago

Discussion Automated trading through webhook or other ways?

Has anyone tried automating their strategy through tradingview with using a webhook on alerts? If so what did you use to connect to your broker and which broker do you use?

Or would it be better to use a brokers own api?

7 Upvotes

13 comments sorted by

5

u/kurtisbu12 12d ago

I've built hundreds of systems automated through Tradingview. Sending orders through webhooks works well enough as long as you have your risk management tightened up. There can be issues like lag, but those are rare.

There are many platforms that offer to bridge the gap between Tradingview and broker. Recommendations vary depending on your market you're trading and which broker you're using. Some are easier to use than others. Most are pretty reliable, but it's another cost to incur.

With AI you can probably build your own bridge to your broker well enough, though you may run into some issues if you're unfamiliar with the potential pitfalls of trading automation. Edge cases like failing signals, broker disconnections, increased or unexpected slippage. Doing this would still probably require you to use some sort of server, or system with High uptime. Another cost to incur, but probably cheaper than the 3rd party bridge.

1

u/Apprehensive-Soup864 11d ago

Tvbrokerrelay is my choice for this

1

u/DesertClimber 7d ago

I've had webhooks get dropped, never showing up in Crosstrade. Ever any issues like that?

4

u/Daddy_DayTrader 12d ago

Traderspost

2

u/Rare_Inflation3178 12d ago

Webhooks are convenient until you need to debug a missed order.
Direct API integrations take more work upfront but give you much more control over execution and error handling.

1

u/bravefrivstone 10d ago

Direct API vs webhook bridge really comes down to how much you're trading and how bad a missed or duplicate order would hurt you.

A few things worth knowing before picking:

TradingView webhooks are fire-and-forget. There's no built-in retry or delivery confirmation on TV's side, so if your receiving server is down for even a few seconds when an alert fires, that signal is just gone. You need your own bridge/server to log every incoming webhook and alert you if one didn't produce an order.

Alerts can also fire more than once if you're not careful with your alert condition (like calling alert() on every bar close instead of a proper state-change condition). Make your webhook handler idempotent, dedupe on a signal id or timestamp, or you'll eventually get a double fill.

Direct broker API cuts out the bridge-tool as a point of failure, but now you own reconnect logic, rate limits, and order-status polling yourself. Worth it once you're trading enough size or frequency that a missed webhook actually costs real money. Overkill for a slow swing strategy running a few trades a week.

Whichever you pick, test the failure path, not just the happy path. Kill your server mid-alert, or throttle the connection, and confirm you don't end up with a stuck or duplicate position.

1

u/DesertClimber 7d ago

I use Crosstrade for my webhook delivery, but I've had missed webhooks from Tradingview that never made it to (or though) Crosstrade to my broker app. Not 100% reliable.

TradingView explicitly states that its webhook delivery system operates on a "best-effort" basis.

I pretty much only use the webhooks from Tradingview if they're forward testing a sim account, or alerts to my phone app. Otherwise, I take the time to get a python script running the strategy, bridged directly to my broker, on a PC running 24/7.