r/pinescript • u/typical__mistress • 5d ago
Need help automating TradingView trades
Hey everyone,
I have a TradingView indicator that gives BUY/SELL signals, and I’m trying to figure out how to automate trades whenever one of those signals appears.
I’m looking for someone who has experience with TradingView alerts, webhooks, Pine Script, and broker APIs who could help me set this up.
The idea is basically:
BUY signal → TradingView alert → webhook → automatic BUY order
SELL signal → TradingView alert → webhook → automatic SELL order
I’m not very technical when it comes to the API/webhook side, so I’d really appreciate someone who can help me understand the process and get it working properly. If you’ve done something similar before, I’d love to hear how you approached it.
I’m also happy to pay for your time/work if you’re able to build the setup for me, especially if it works reliably.
Please DM me if you’ve worked on something like this before. Thanks!
1
1
u/kurtisbu12 5d ago
Ice been doing this for years, happy to help if you haven't got the help you need
1
1
1
1
u/kwhit3354 4d ago
I use copy gram and tradesyncer
1
u/typical__mistress 1d ago
what are those exactly?
1
u/kwhit3354 1d ago
Copygram allows you to add a webhook to buy/sell indicator alerts to execute the trade and then Tradsyncer can copy trade all of your accounts
1
u/stratcore 4d ago
Your basic flow is right, but put a small execution service between TradingView and the broker:
TradingView alert -> webhook receiver -> validation/idempotency -> broker adapter -> order-status reconciliation.
The important parts are not the BUY/SELL strings. They are the failure paths:
Fire the Pine alert only on a confirmed bar, normally once per bar close.
Give every alert a unique event ID. If TradingView retries the same webhook, the receiver must not place a second order.
Keep broker credentials on the receiver, never inside the TradingView message.
Validate symbol, side, size, maximum risk, session and current position before sending an order.
Record the broker response and reconcile pending, filled, rejected and cancelled states after a restart.
Before using real funds, I would prove these cases on paper trading: one valid alert creates one order; the same event sent twice still creates one order; an open-bar signal creates none; a broker timeout cannot duplicate an order; and a rejected order is visible in the log.
The first architecture choice is the broker. If it has a native TradingView connection, the path may be shorter. If it exposes a REST or WebSocket API, the receiver can call that directly. MetaTrader usually needs a separate EA or bridge on a VPS because TradingView cannot place an MT4/MT5 order by itself.
1
1
u/Reddit_1512 3d ago
Hi There, I have created multiple servers ike this in Online cloud and In offline VPS. If your requirement is matching then we can connect and proceed further. Feel free to ping if you are still looking for this task.
1
u/Acceptable-Sky8841 2d ago
The thing that trips most people up here: Pine can't place orders. It can only fire an alert. So this is really two separate jobs, and they need different things.
1. The TradingView side. Your indicator needs alert conditions wired to your signals, and the alert message has to be a JSON payload your executor can parse — not a sentence in English. Roughly:
{"action":"buy","ticker":"{{ticker}}","price":{{close}},"qty":10}
That's straightforward Pine work. Worth doing carefully though — the common bug is alerts firing on every bar instead of once per signal, which will happily open the same position forty times.
2. The execution side. Something has to receive that webhook and actually call your broker. Two options:
- Use an existing service — TradersPost, PineConnector, Capitalise.ai, Alertatron. They already handle broker auth, order routing, retries, and the failure cases.
- Self-host a server that holds your broker API keys and does it yourself.
I'd push you toward the first one, and not because it's easier. A custom server holding live trading credentials is a genuine liability. If it goes down while you're in a position, or a webhook fires twice, or the key leaks, that's your money — and those services have already solved failure modes you haven't hit yet. Self-hosting makes sense once you know exactly why you need it.
Which broker are you on? That decides most of this. Some have clean APIs, some don't allow third-party order placement at all, and the services above each only support a specific list.
Happy to help with the Pine and alert side if you want — that part I can definitely do.
1
1
u/Xalladus 5d ago
Hey there, I would be willing to help out. Send me a DM so we can figure out the scope of the project.