Skip to content

AI

AI-Built Trading Bot, Strategy or Connector: Which Are You Actually Building?

"Build me a trading bot" is one sentence that can mean four different projects. It can mean a strategy that decides when to trade, an alert that announces the decision, a connector that carries the instruction to a broker terminal, or a machine that keeps that terminal running all night. People use "bot" for any of them, and often for all of them at once, which is why so many conversations with ChatGPT or Claude about trading automation go sideways in the first five minutes.

The short answer to "which am I building?" is: probably only one or two of the four, and the others are either already solved for you or are decisions no software can make. This article names the four layers, shows who owns each, and walks one ordinary request through them so you can see where your effort, and your risk, actually sits.

The four layers

Layer 1: strategy logic. The rules. When to enter, when to exit, how much to risk, what to do when the rules disagree with each other. This lives in code, typically Pine Script on TradingView or MQL5 inside MetaTrader, but the code is only a transcription of decisions you made. No connector and no hosting product changes whether those decisions are good.

Layer 2: signal generation. Turning a rule firing into a message. On TradingView, this is the alert system. TradingView's documentation is precise about the division of labour: a script defines the conditions, and "users then create running alerts from these events via the charts UI"; no Pine Script code creates a running alert by itself.[1] For strategies, order-fill alert text is customised with the alert_message parameter, and the alert must include the {{strategy.order.alert_message}} placeholder for that text to appear.[1] TradingView alerts "run 24x7 on our servers and do not require users to be logged in to execute".[1] So this layer runs on TradingView's infrastructure, but its content is yours.

Layer 3: order routing. Carrying the message to a terminal and placing the order. TradingView's side of this is a webhook: "we will send a POST request as soon as the alert is triggered, with the alert message in the body of the request."[2] Something has to receive that request, understand it, and hand it to MetaTrader. That something is the connector. In PineConnector's case the message is a single line in the format LicenseID,Command,Symbol,Parameters, for example 60123456789,buy,AUDUSD,vol_lots=0.1, and the PineConnector EA on the terminal turns it into an order.[3]

Layer 4: terminal hosting. Keeping MetaTrader 5 running. MetaQuotes describes Expert Advisors as programs that run inside the terminal, and lists "Turn off the trading platform" and "Close the chart the Expert Advisor is running on" among the ways an EA stops.[4] If the machine sleeps, the EA is gone, and layers 1 to 3 can fire all they like into nothing. This layer is pure infrastructure: a PC left on, a Windows VPS, or a managed service.

Illustrative diagram: four layers of trading automation, strategy logic, signal generation, order routing and terminal hosting, with the owner of each labelled

Why the word "bot" causes trouble

When a forum post says "my bot stopped working", it could mean the strategy stopped generating signals (layer 1 or 2), the webhook stopped arriving (layer 3), or the VPS rebooted overnight (layer 4). Each has different evidence and a different fix. Our stage-by-stage diagnosis exists precisely because one word hides five failure points.

The confusion is more expensive when you ask an AI assistant for help. A prompt that says "write me a trading bot for EMA crosses on MT5" will usually produce layer 1 code, an MQL5 Expert Advisor, because that is the most literal reading. If what you actually wanted was to keep your TradingView strategy and route its alerts, that code is the wrong artefact entirely. Conversely, asking for "a webhook receiver that places MT5 orders" gets you layer 3 plumbing with no strategy in it, and, as we cover in whether ChatGPT or Claude can build a bridge, it leaves layer 4 and all the operating work untouched. The assistant is not wrong in either case. The request was ambiguous.

One request, decomposed

Take the sentence most people actually type: "Build me a bot that trades EMA crosses on my MT5 account." Here is what it contains.

Layer What the sentence is asking for Who or what handles it What still needs a human
1. Strategy logic "EMA crosses": which lengths, which timeframe, long only or both, stop and target, position size, what happens on a gap You, in Pine Script (or MQL5 if you go native). An assistant can draft code but not the decisions. Every parameter. Whether the idea survives a backtest and a demo period. Your risk limits.
2. Signal generation "trades": something must announce each cross as an instruction TradingView alerts, created by you in the chart UI from the strategy's order events[1] Writing the alert message correctly, including the placeholder, and recreating the alert when the script changes
3. Order routing "on my MT5 account": the instruction must reach a specific terminal and become an order A connector. PineConnector Bridge receives the webhook and its EA places the order in the format above[3] Pointing the alert at the right webhook URL and licence, choosing the correct symbol name for your broker, testing on demo first
4. Terminal hosting Implied, never stated: the terminal has to be running when the cross happens Your PC or VPS, or PineConnector Edge, which states: "We host and maintain MT5 and the PineConnector EA, so you do not need to keep your own computer or VPS running."[5] Choosing where it runs. Entering your own broker login. Knowing what the host can and cannot change.

Notice what is left after the software is in place: every row still has a human column. That is not a flaw in the tools. It is the shape of the problem.

Where each layer can go wrong, in one line each

  • Layer 1 fails when the rules are wrong or untested. A perfectly delivered, perfectly executed losing trade is a layer 1 outcome, not an infrastructure failure.
  • Layer 2 fails when the alert text is malformed, or when you change the script and forget that the existing alert still uses the old settings.
  • Layer 3 fails when the webhook is not delivered, is cancelled because the receiver took too long (TradingView: "If a remote server takes longer than three seconds to process a request, the request will be cancelled."[2]), or the instruction is rejected by the terminal or broker. TradingView also notes that "webhooks may occasionally fail to reach the specified URL".[2]
  • Layer 4 fails when the terminal is not running: sleep, reboot, a crashed EA, an expired session.

One security note belongs at the boundary between layers 2 and 3. TradingView's guidance is to "ensure that you don't include sensitive information such as login credentials or passwords in the webhook body".[2] Any design, DIY or bought, that puts your broker password in an alert message has skipped that advice.

Where PineConnector sits, and where it does not

PineConnector is a layer 3 product: the Bridge receives your TradingView webhook and its EA places the order. With PineConnector Edge, it also takes on layer 4 as managed MT5 hosting. Edge's own guide draws the line the same way this article does: "Your strategy and alerts remain on TradingView, and you stay in control of your trading instructions and broker account."[5] The product page puts it more bluntly: "PineConnector Edge is managed infrastructure, not managed execution. PineConnector runs the machine your MetaTrader 5 terminal sits on. Your strategy, your broker, your account and every trading decision remain yours."[6]

Two boundaries on the hosted layer are worth knowing before you plan around it. First, "Edge does not support custom or other third-party EAs",[5] so if your layer 1 lives in your own MQL5 Expert Advisor, Edge is not the place to run it; you keep your own terminal. Second, during Early Access, EA settings on Edge "use a fixed default configuration and cannot be edited",[5] with customisation described as planned. Edge is MetaTrader 5 only, hosted instances run in New York with London planned for the Plus and Pro plans, and hosting is included in every plan: Core $59 a month with one connection and one hosted MT5 instance, Plus $129 with three, and Pro $199 with five.[6]

Layers 1 and 2 are not PineConnector's job and never will be. If your strategy is unprofitable, faster routing and better hosting deliver the losses more reliably. That is the whole reason to separate the layers before you build any of them.

Who should read the layers differently

  • You want to learn and own the whole stack. Build all four. Start with the build-or-buy comparison so you know the ongoing work you are signing up for, and run the nine tests before a live account sees it.
  • Your strategy is in Pine Script and you want it executed on MT5. You own layers 1 and 2. Buy or adopt layer 3, and decide layer 4 deliberately: your own machine, a VPS, or Edge. Rewrite or route covers the fork in the road.
  • Your strategy is in MQL5. Layers 1 to 3 collapse into your Expert Advisor. You need layer 4 only, and Edge is not it, because it runs PineConnector's EA only. A Windows VPS or your own machine is the right answer.
  • You have no strategy yet. Stop at layer 1. Nothing downstream is worth building until there is a rule set you have tested on a demo account.

Frequently asked questions

Is PineConnector a trading bot? Not in the strategy sense. It does not decide trades. It is a connector (layer 3) and, with Edge, a host for the MetaTrader 5 terminal (layer 4). Your TradingView strategy decides; PineConnector carries and executes the instruction.

Can an AI assistant build all four layers for me? It can draft code for layers 1 and 3 and explain layers 2 and 4. It cannot make your risk decisions, create the alert in TradingView's UI for you, or keep a terminal running. See what code generation does and doesn't give you.

If I use Edge, which layers do I still maintain? Layers 1 and 2 entirely, plus the parts of layer 3 that are yours: correct alert text, correct symbol names, testing on demo. Edge runs the terminal and the PineConnector EA; it does not edit your strategy or your alerts.

Where should I start if my "bot" stopped working? Work out which layer stopped. The stage-by-stage diagnosis gives you the evidence to look at for each.

Next step

Write down which of the four layers you are actually building, and which you are buying or delegating. If layer 4 is the one you want off your plate, read what PineConnector Edge is and who it suits, then check the Edge Guide for the current scope before you commit.

Reviewed 10 September 2026. Facts and prices were checked against the linked sources on that date.

Sources

  1. TradingView – Pine Script documentation: Alerts, accessed 10 September 2026.
  2. TradingView – How to configure webhook alerts, accessed 10 September 2026.
  3. PineConnector Docs – Syntax, accessed 10 September 2026.
  4. MetaQuotes – MetaTrader 5 Help: Algorithmic Trading (Expert Advisors), accessed 10 September 2026.
  5. PineConnector Docs – Edge Guide (Early Access), accessed 10 September 2026.
  6. PineConnector – PineConnector Edge: Managed MT5 Hosting, accessed 10 September 2026.

PineConnector executes the instructions you send it. It does not select trades, manage money, or hold funds. Trading carries risk, and past performance of any strategy does not indicate future results.


Leave a comment

Back To PiCo Blog

Ready when your strategy is

You bring the strategy.We bring the infrastructure.

Connect TradingView to MetaTrader, choose where MT5 runs and put the full PineConnector workflow through its paces from your first month.

Strategy and trading decisions remain yours. The MT5 environment can be ours.

PineConnector Edge

Run the full PineConnector workflow.

$59/mo at launch

Core plan · 1 connection · 1 hosted MT5 environment

Start with Core

Launch price — standard pricing is $69/mo after the launch period.