tradingview tutorial execution

How to automate trading in TradingView, from alert to live fill

Automate trading in TradingView step by step. How alerts, Pine Script and webhooks fit together, and what breaks when you connect to a live broker.

Jonathan FillEdge 11 min read
How to automate trading in TradingView, from alert to live fill — FillEdge
In this article
  1. Does TradingView have automated trading, or not
  2. What automated trading inside TradingView actually is
  3. Can you automate trading on TradingView without writing code
  4. How to automate trading in TradingView in six steps
  5. Does TradingView allow automated trading directly with your broker
  6. What breaks between TradingView and your broker
  7. How to automate trading in TradingView with FillEdge
  8. TradingView automated trading features worth knowing before you go live
  9. FAQ

You found a TradingView strategy that works. The backtest looks honest, the equity curve isn't drawn on a napkin, and you want to stop babysitting EURUSD at 3 a.m. So the next question is obvious. Can TradingView actually trade for you?

The answer is yes, but with a catch most beginners miss. TradingView generates signals. It does not, on its own, place trades with most brokers. Getting from "chart fires a signal" to "0.1 lots of EURUSD opens on your MT5 account at IC Markets" is a pipeline, and it's the pipeline, not the strategy, that kills most first automation attempts.

This is the beginner guide to that pipeline. What automation actually is inside TradingView, how to set it up end-to-end, which brokers TradingView talks to directly, and where the real failure points hide. If you've been Googling how to automate trading in TradingView and getting a dozen half-answers, this is the version that connects the dots.

Does TradingView have automated trading, or not

Short version. Yes, partially. Here's what "partially" means.

TradingView has three things that matter for automation. Pine Script, the language you write strategies in. Alerts, which fire when your strategy says to buy or sell. And webhooks, which let those alerts send a message to an external service when they fire.

What TradingView doesn't have is a built-in execution engine for every broker on earth. It has direct broker integrations with a handful of names. Interactive Brokers, Tradovate, OANDA, TradeStation, a few more. For these, you click a button and your strategy trades live.

For everything else, including MetaTrader 4 and MetaTrader 5, you need a bridge. That's a separate piece of software that takes the TradingView alert and turns it into an order on your broker.

So when someone asks, does TradingView have automated trading, the honest answer is this. The signal half, yes, natively. The execution half, sometimes natively, often through a bridge.

What automated trading inside TradingView actually is

Three layers. Understand them once and the rest of this guide clicks.

Layer one is Pine Script. This is the language TradingView uses for indicators and strategies. A strategy is a script that decides when to enter, exit, set stops, take profits. You can write your own or use one of thousands in the public library.

Layer two is alerts. When your strategy says "buy now," TradingView needs to tell someone. Alerts are how. An alert is a rule attached to a script. When this condition is true, fire a notification. That notification can be an email, a mobile push, a popup, or a webhook.

Layer three is webhooks. A webhook is an HTTP request. When your alert fires, TradingView sends a small JSON payload to a URL you specify. Whatever's on the other side of that URL handles execution. If it's your broker's webhook endpoint, you get a trade. If it's a bridge service like FillEdge, the bridge forwards to MT5 and places the order there.

That's it. Strategy decides. Alert fires. Webhook delivers. Every automation setup in TradingView is some version of this three-layer stack.

Can you automate trading on TradingView without writing code

Yes, and most retail traders start here. You don't need to know Pine Script on day one.

Your options, ranked by how much control you get.

  • Use a public strategy from the library. TradingView's public library has thousands of strategies. Open a chart, hit Indicators, search for "strategy," pick one. Many of them come alert-ready, meaning the author already wrote the alert conditions. You add the alert, point it at a webhook, done.
  • Use a paid indicator. Indicator shops on TradingView sell scripts that include alert hooks. Usually better documented. Expect $20 to $200 one-time or subscription.
  • Subscribe to a signal service. Someone else runs the strategy. You receive alerts on your TradingView account and pipe them to your broker the same way. This is the laziest path and also the riskiest. You're trusting someone else's edge.
  • Copy a strategy from a YouTube tutorial. Pine Script is readable enough that you can usually copy a 50-line script, paste it into the Pine editor, and have it running on your chart in five minutes. This is how most people figure out how to create a trading bot in TradingView without ever calling themselves developers.

The ceiling on no-code automation is real but higher than beginners expect. Where you hit the wall is when you want specific risk rules, multi-symbol coordination, or custom stop-loss logic. At that point, you open the Pine editor and start learning.

How to automate trading in TradingView in six steps

This is the part most guides skip over. Here's the whole sequence, start to finish, with what actually matters at each step.

Step 1. Get a TradingView plan that supports webhooks. Free plans don't have webhook alerts. You need Essential at minimum, which is about $15 per month. If you skip this step, you'll find out the hard way when the webhook option is greyed out.

Step 2. Add a strategy to your chart. Either write one in Pine Script or pull one from the library. Make sure it's a strategy, not an indicator. Strategies have strategy.entry() and strategy.exit() calls in the code. Indicators just draw lines.

Step 3. Backtest it. Click the Strategy Tester tab at the bottom of the chart. Check the trade list, not just the final PnL. Look for suspicious patterns. A strategy that took one trade per year for nine years isn't backtested, it's overfit. Pay attention to the profit factor and max drawdown. Ignore the win rate on its own. A 30% win rate can be wildly profitable. An 80% win rate can be a disaster.

Step 4. Create the alert. Right-click the chart, Add Alert, or press Alt+A. Set the condition to your strategy's alerts (you'll see the strategy's name in the dropdown). For the notification, choose Webhook URL. Paste the URL your bridge or broker gave you. In the message box, include the JSON payload the receiver expects. Exact format matters. One typo means no trade.

Step 5. Connect to execution. This is where the road forks. If your broker is on TradingView's native list, skip to step 6. If you're on MT5 with a broker that doesn't have native TradingView integration, you need a bridge. Install the bridge's MT5 expert advisor on your terminal, get your webhook URL from the bridge dashboard, and paste it into the alert message.

Step 6. Paper test, then go live tiny. Every bridge and most brokers have a demo account mode. Run the whole pipeline against a demo for at least a week. When you switch to live, start with the minimum lot size your broker allows. The goal isn't profit on day one. The goal is to see every edge case. A reversal, a stop-out, a missed fill, a weekend gap. In a size where being wrong is cheap.

If you want a deep dive on the alert-and-webhook part specifically, the piece on TradingView webhook alerts walks through the payload formats and common mistakes.

Does TradingView allow automated trading directly with your broker

Sometimes. It depends on who you trade with. The question does TradingView allow automated trading straight into a broker account has two answers, split by which broker.

TradingView has native broker integrations with Interactive Brokers, Tradovate, OANDA, TradeStation, FOREX.com, Saxo, and a growing list of others. For these, you log into your broker from inside TradingView and trades execute directly. No bridge, no webhook, no third-party tool. This is as smooth as automation gets.

For MetaTrader 4 and MetaTrader 5, which are used by most retail forex and CFD brokers, there is no direct integration. TradingView and MetaQuotes don't have a handshake. To send TradingView signals to an MT5 account, you need a webhook bridge that speaks both sides of the conversation. That's the whole category FillEdge sits in, and it's worth its own guide on how to connect TradingView to MT5 without losing your mind.

Prop firm accounts are almost always MT5 or cTrader, which means prop firm traders automatically fall into the bridge category. If you're evaluating a funded account, assume bridge.

What breaks between TradingView and your broker

This section won't make you paranoid. It'll make you specific.

Three failure modes show up again and again when retail traders connect TradingView to MT5. None of them appear in the backtest. All of them can end a real account.

Phantom positions. The TradingView alert fires the instant your Pine Script calls strategy.entry(). Not when the market actually fills the order on TradingView's internal engine. If price moves fast, the fill might not happen, or happens at a different price. Your bridge has already sent "open long" to MT5. Now you have a position on the broker that doesn't exist on your chart.

Signal reordering. Your strategy flips from long to short. Two webhooks go out nearly simultaneously. Close the long, open the short. Webhooks travel over HTTP. They don't arrive in guaranteed order. If the open arrives first, the EA opens the short. Both positions sit on the account briefly. When the close long arrives a moment later, the EA looks for a long to close and finds two positions tagged with its magic number. If its close logic picks the most recently opened one, it closes the freshly opened short. The long stays. You end up holding the position your strategy was trying to exit.

Stop-loss drift. Your strategy says "stop 50 points below entry." The bridge sends "SL distance = 50 points." You fill 2 points slipped. The bridge calculates SL from the fill price, not the intended entry. Your stop is now 2 points off from where your strategy logic wanted it. Small, cumulative, silent. It adds up.

These aren't theoretical. You might think TradingView alerts are not working. The alert usually is working. The execution after the alert is what breaks.

How to automate trading in TradingView with FillEdge

FillEdge is a bridge between TradingView and MT5 built specifically around the three failure modes above. If you're working out how to automate trading in TradingView specifically with a MetaTrader account, this is the piece that sits between your chart and your broker.

For phantom positions, FillEdge doesn't use TradingView's default alert_message mechanism. Instead, the FillEdge Pine Script template only fires the webhook after a fill is confirmed. If the market doesn't fill, nothing gets sent. No phantom.

For signal reordering, the FillEdge server sequences signals in the correct order regardless of when they arrive over the network. A close-then-open reversal executes as close-then-open on MT5. Every time.

For stop-loss drift, FillEdge lets you pick per strategy. Exact-price mode transmits the level your Pine Script calculated. Distance mode preserves the offset from actual fill for ATR-based strategies. Your SL lands where your strategy logic intended.

Every signal gets a status badge in the dashboard. ✓MATCHED means TradingView and MT5 agree on the trade. 👻CAUGHT means a phantom was blocked. 🔀REORDERED means a reversal pair was sequenced correctly despite arriving out of order. You don't compare two screens and hope. The badge tells you what happened.

FillEdge also monitors the pipeline on its own. Synthetic test signals travel the full path on a regular cadence, without opening a trade. If any leg goes down, you get an email or Telegram alert within minutes, so your EA crashing at four in the morning stops being a mystery you discover at breakfast.

If you run more than one strategy on the same MT5 account, FillEdge keeps each one isolated. Signals from your gold breakout strategy won't close positions belonging to your EURUSD mean-reversion. Each strategy gets its own lane, its own stats, its own reconciliation log.

The setup itself is a guided wizard. Six steps, each verified before you move to the next. The dashboard builds your alert message for you: pick your strategy, pick your account, pick your command, copy, and paste into TradingView. A test signal confirms the full pipeline is alive before your first real trade fires. Fifteen minutes, no coding, no MQL5.

TradingView automated trading features worth knowing before you go live

A few things that will bite you if you don't know them upfront.

Alert limits. TradingView caps the number of active alerts per plan. Essential gets 20, Plus gets 100, Premium gets 400. If you're running one alert per strategy, you'll feel the ceiling on Essential when you trade more than a couple of pairs.

Webhook rate limits. TradingView rate-limits how fast webhooks can fire from a single account. This matters when a strategy takes lots of rapid trades or when you're running many symbols. Plan for it.

Bar-close vs real-time execution. A Pine Script strategy can fire signals either at bar close (only when the candle finishes) or intrabar (any time during the candle). Intrabar fires more often but introduces repainting risk. A signal that appeared at 10:23 may disappear by 10:29 when the bar closes. For automation, bar-close is almost always the safer default.

Paper trading mode. TradingView has a built-in paper account. Use it. Every strategy should run on paper for at least 30 days before it touches real money, even if the backtest looks perfect. Live paper catches things backtests miss. Actual spreads, actual latency, actual off-hours gaps.

Pine Script isn't unlimited. It can't make HTTP requests from inside the script, it can't read external data feeds, it can't persist state between sessions beyond what TradingView exposes. If you hit a wall and think "I just need Pine Script to do this one extra thing," check the piece on TradingView Pine Script limitations first. It probably can't, and the workaround is usually a bridge or an external service.

FAQ

Is TradingView automated trading free?

No. Webhook alerts, which are the only way to send TradingView signals to an external broker or bridge, require a paid TradingView plan starting around $15 per month on the Essential tier. On top of that, if you use MT5 or MT4 platforms you'll also need a bridge service and a small VPS to keep MetaTrader running 24/7, which puts a realistic all-in monthly cost around $50.

Do I need coding skills to automate trading on TradingView?

No. You can pull a ready-made strategy from TradingView's public library, attach a webhook alert to it, and be live without writing a single line of Pine Script. Most retail traders start this way. You'll hit a ceiling eventually when you want custom risk rules or specific stop-loss logic, and at that point learning basic Pine Script pays off quickly since it's one of the simpler scripting languages out there.

Can TradingView trade for me while my computer is off?

Yes, but not from your computer. TradingView runs your strategy on its own servers and fires alerts to webhooks from there, so if you use a native broker integration like Interactive Brokers, OANDA, or Tradovate, there's nothing on your side to keep alive. If you use a bridge to MT5, your MetaTrader terminal with the bridge expert advisor has to stay online, which is why most algo traders run it on a cheap VPS instead of their home machine.

More from FillEdge

Lock the best price before FillEdge opens to general public.

The first 50 traders lock today's price permanently — it never goes up, no matter the features we add. Get early access and we'll email you the moment the bridge is live.

Join and you'll only get FillEdge launch updates. Unsubscribe anytime.