What a TradingView webhook bot does
TradingView can send an alert to a web address (a webhook) when your indicator or strategy fires. It cannot place orders at most brokers by itself. A webhook bot is the missing piece: a small program on a server that receives the alert, checks that it is genuine and sensible, and sends the order to your exchange or broker through its official API. The bot follows the rules in your alerts and the limits you set. It does not decide what to trade, and it cannot make a strategy profitable. Trading carries a real risk of loss.
What we build
- Webhook receivers for crypto exchanges such as Binance, Bybit, Coinbase, Kraken and OKX, using their official APIs.
- Stock and options routing to brokers with official APIs, such as Alpaca, Interactive Brokers and Schwab. More on brokers is on trading bot development.
- TradingView to MT4/MT5 bridges: a receiver plus an Expert Advisor that collects each signal and trades it with lot, loss and hours limits. See MT5 Expert Advisor development.
- Pine Script work: writing or fixing indicators and strategies, and building clean alert messages in JSON so the bot gets every value it needs.
- Telegram signal bots that post each alert to you or a private channel, with or without placing orders. See Telegram and Discord bots.
- Dashboards showing received alerts, orders, fills, open positions and errors, with a pause switch.
How a TradingView webhook bot works
- TradingView alertYour Pine Script fires and posts a JSON message
- ReceiverChecks the token and source IP, replies fast, queues the signal
- Risk checkDuplicates, position size, daily loss cap, trading hours
- Order routerExchange, broker API or MT5 Expert Advisor
- Log and alertsEvery signal, order and fill, with Telegram messages
The receiver answers TradingView within a second and does the trading work afterwards, because TradingView cancels a webhook request that takes longer than three seconds.
TradingView webhook rules your bot must respect
| Rule (from TradingView's help pages) | What it means for the bot |
|---|---|
| Webhooks need two-factor authentication on the account, and are not on the free plan | You need a paid plan with 2FA turned on before testing can start |
| Only ports 80 and 443 are accepted, and IPv6 is not supported | The receiver runs on a normal HTTPS address on an IPv4 server |
| Requests taking longer than three seconds are cancelled | Reply first, then process the signal from a queue |
| Valid JSON is sent as application/json, anything else as text/plain | We design a fixed JSON alert format and reject anything that does not match |
| Alerts come from four published IP addresses | The server can allowlist those addresses and refuse the rest |
| Webhooks can occasionally fail to arrive | The bot reconciles with the broker's real positions and alerts you when a signal is missing |
Alert counts and how long alerts stay active also depend on your TradingView plan, and TradingView can change these rules, so we check them again at the start of each project.
Common problems we fix
- Repainting. Some indicators change past signals once a bar closes, so the backtest looks better than live trading. We check the script, fire alerts on bar close where it matters, and compare live alerts with the chart.
- Duplicate or out-of-order alerts. Every signal gets an ID; repeats are ignored and an exit never runs before its entry.
- Position drift. If a fill is partial or an order is rejected, the bot reads the actual position from the broker instead of trusting its own memory.
- Tester versus live. Fees, spread, slippage and minimum order sizes are added so you can see how far live results may differ from the Strategy Tester.
Features we include as standard
- A per-bot secret token in the alert, never your exchange or broker keys
- API keys on the server with trading-only permissions and withdrawals turned off
- Maximum position size, maximum orders per day and a daily loss cap that stop the bot
- Paper or demo trading first, then a small live size
- A kill switch in Telegram or the dashboard that cancels open orders and pauses trading
- Logs of every alert received and every order sent, kept for review
Tech stack
Pine Script v6 for alerts and strategies; Python (FastAPI) or Node.js for the receiver; ccxt and exchange SDKs for crypto; Alpaca, Interactive Brokers (TWS API or IB Gateway) and Schwab Trader APIs for stocks; MQL5 for MT5 Expert Advisors; Redis or PostgreSQL for the signal queue and logs; Telegram Bot API for alerts; Docker on a small cloud server or VPS close to the exchange or broker.
Webhook bot or ready-made connector?
Hosted services that forward TradingView alerts to brokers are fine for simple setups and cost a monthly fee. A custom bot makes sense when you need your own risk rules, a broker or exchange the service does not support, MT5 with prop-firm limits, several strategies on one account, or full control of your keys and logs. For crypto, open-source frameworks are another route; we compare them in Freqtrade vs Hummingbot vs a custom bot.
TradingView bot cost: planning ranges at $50/hour
| Project | Typical hours | Typical cost |
|---|---|---|
| Pine Script indicator or strategy, with alert messages | 10–30 h | $500–$1,500 |
| Webhook bot, one crypto exchange or broker | 30–60 h | $1,500–$3,000 |
| TradingView to MT5 bridge (receiver plus Expert Advisor) | 40–80 h | $2,000–$4,000 |
| Webhook bot with dashboard and Telegram commands | 60–110 h | $3,000–$5,500 |
| Several strategies and accounts, with per-account limits | 80–160 h | $4,000–$8,000 |
Running costs are usually a TradingView paid plan, plus a server at roughly $10 to $40 a month. Try your own mix in the bot cost calculator.
How we work
- Alert spec. We agree the exact JSON your alerts send and what the bot does with each field.
- Build on paper or demo. The bot trades a paper, testnet or demo account first.
- Side-by-side check. We compare alerts on the chart with orders the bot placed for at least a week.
- Small live start. Live trading begins with small sizes and tight limits that you raise yourself.
- Handover. Source code in your repository, deployment on your server, a setup guide, and optional support.
Risks and compliance
- Automated trading can lose money fast, especially with leverage. Limits reduce damage but cannot remove risk, and we never promise returns.
- You are responsible for TradingView's terms, your exchange's or broker's terms, any prop-firm rules and the laws where you live. Selling signals or managing other people's money may need a licence.
- We do not build bots that copy trades across prop-firm accounts against the firm's rules, exploit latency, or get around platform limits.
Hire a Pine Script developer: indicators, strategies and non-repainting alerts
Many projects start with the script, not the bot. We write and fix Pine Script v6 for TradingView, either on its own or as the signal side of a webhook bot:
- Indicators: your own signals, multi-timeframe filters, sessions, levels and labels, with inputs you can change without touching code.
- Strategies for the Strategy Tester: entries, exits, stops, take-profits and position sizing written with
strategy(), with commission and slippage set so the tester is closer to live results. - Alerts:
alert()andalertcondition()messages in clean JSON, so a webhook bot, trade copier or Telegram channel gets every value it needs. - Non-repainting fixes: signals confirmed on bar close (
barstate.isconfirmed), higher-timeframe data requested without lookahead, and a side-by-side check of live alerts against the chart. - Upgrades and conversions: older v4 or v5 scripts moved to v6, and strategies converted between Pine Script, MQL5, NinjaScript and Python.
A single indicator is often 10 to 20 hours ($500 to $1,000) at $50 per hour; a strategy with alerts is often 15 to 30 hours ($750 to $1,500). You get the full source code. Send the rules in plain words or your existing script, and we reply with questions and an estimate.
Hire a TradingView bot developer
You work directly with our engineers in Lahore, Pakistan, building software for clients worldwide since 2014. Send your Pine Script or strategy rules through the contact form, or hire us on Freelancer.com, where we are a Preferred Freelancer with a 4.9 average from 356 reviews. Every bot we offer is listed on the bot development page.
Questions clients ask
How much does a TradingView webhook bot cost?
At $50 per hour, a webhook bot that turns your alerts into orders on one crypto exchange or broker is usually 30 to 60 hours ($1,500 to $3,000). A TradingView to MT5 bridge with a receiver and an Expert Advisor is about 40 to 80 hours ($2,000 to $4,000). Writing or fixing a Pine Script strategy on its own is often 10 to 30 hours ($500 to $1,500).
Do I need a paid TradingView plan for webhooks?
Yes in practice. Webhook alerts are not available on the free Basic plan, and TradingView only sends webhooks from accounts with two-factor authentication turned on. Alert limits and how long alerts stay active depend on your plan, so check TradingView's current plans before we start.
Can TradingView alerts place trades in MetaTrader 5?
Not directly. TradingView posts the alert to a web address, and MT5 has no web address of its own. We build a small receiver on a server that checks and queues each signal, and an Expert Advisor in MT5 that collects the signal and places the order with your risk limits.
What happens if a webhook is missed or sent twice?
TradingView says webhooks can occasionally fail to arrive, and alerts can repeat. The receiver gives every signal an ID, ignores duplicates, checks the position the broker actually holds before each order, and alerts you on Telegram when a signal fails or the bot and the broker disagree.
Is it safe to put my exchange API key in the alert message?
No. TradingView itself warns against putting credentials in the alert body. Your exchange or broker keys stay on the server, with trading-only permissions and no withdrawals. The alert carries only a random token that lets the receiver accept it, plus an allowlist of TradingView's published sending IP addresses.
Will the bot make my strategy profitable?
No bot can promise that. The bot places the trades your alerts describe, with limits you set. Whether that makes money depends on your strategy and the market, and live results often differ from the TradingView Strategy Tester because of fees, slippage and repainting indicators.
Can you make my Pine Script indicator stop repainting?
Usually, yes. We find where the script uses values that change before a bar closes, such as unconfirmed bars or higher-timeframe data requested with lookahead, and change the signal to fire on confirmed bars only. Signals may then arrive one bar later than the repainting version showed, which is the honest picture of what you could have traded.
Can you convert my Pine Script strategy to MT5, NinjaTrader or Python?
Yes. Pine Script runs only on TradingView, so to trade without TradingView in the loop we rewrite the same rules as an MT5 Expert Advisor in MQL5, a NinjaScript strategy or a Python bot, then compare its signals bar by bar with the original script on the same data before going live.