REX·TRADING Join on Telegram

The machine you buy has to be maintained

How to Automate TradingView Strategy Execution

Everybody building one of these worries about speed. Speed turns out to be worth cents. The number that actually decides whether it works is the one nobody checks before building.

REX Trading Signal logo
Rex · @REXTradingSignal · 11.9K followers
How to automate tradingview strategy execution, REX Trading Signal cover image on the reliability of a signal to broker chain

The question of how to automate tradingview strategy signals arrives, almost every time, as a speed question. Somebody has a strategy that works when they run it by hand, they are tired of sitting at the screen at two in the morning, and they want the alert to reach the broker faster than a human thumb can manage.

The plumbing has a straightforward answer and I will go through it. But I want to put the conclusion at the top, because it is the opposite of what most people building these things spend their attention on. I ran the arithmetic on both halves of this and the speed is worth cents. The reliability is worth days. Almost everybody optimises the first and never measures the second.

This is a purchasing decision, not a coding project. You are buying a machine for the business. The right questions are the ones you would ask about any machine: what does it cost to install, what does it cost to keep running, how often will it be out of service, and what happens to the work in progress when it stops.

How to Automate TradingView Strategy Signals, Mechanically

The chain has four links, and naming them is most of the work because each one is a thing that can fail independently.

Link one, the signal. A strategy or indicator on the chart evaluates a condition and fires an alert. The important detail here is when it fires. An alert set to trigger on the close of a bar is stable and repeatable. An alert set to trigger on intrabar movement can fire, unfire and fire again inside the same candle, which downstream becomes three orders instead of one.

Link two, the messenger. The alert carries a payload, usually to a web address you control. This is the point where the signal leaves a service you rent and enters infrastructure you are responsible for.

Link three, the translator. Something has to receive that payload and turn it into an instruction the broker understands, which means sizing the position, checking that it does not duplicate an order already open, and deciding what to do if the account state is not what the strategy assumed.

Link four, the broker connection. The instruction is submitted, and either it fills, or it is rejected, or, worst of all, the response is lost and you do not know which.

You can rent links two and three from a bridge service or build them yourself. That choice changes who fixes it at three in the morning, and very little else. What it does not change is the count: four links, all of which must be working simultaneously for the machine to do its job.

The Number to Check Before You Build Anything

Here is the calculation I have never once seen someone do before building one of these.

Availability multiplies. It does not average. If each of your four links is up 99.9 percent of the time, the chain is not up 99.9 percent of the time. It is up 0.999 to the fourth power, which is 99.6 percent.

There are 8,760 hours in a year. Run those numbers out:

Chart on how to automate tradingview strategy execution, showing expected hours offline a year against the number of links in the chain, 35.0 hours for four links at 99.9 percent each and 173.9 hours at 99.5 percent each
How to automate tradingview strategy execution and know what it costs: expected hours a year the chain is not running, by number of links and per link reliability.

A four link chain where every link manages 99.9 percent uptime is unavailable for 35 hours a year, which is about a day and a half. If the links only manage 99.5 percent each, which is a far more realistic number for a hobby setup on shared hosting, it is 174 hours, or better than seven full days.

Seven days a year where your machine is not running. Now ask the question that matters for a business: what is your position doing during those hours? If the answer is "flat, because it never opened", that is a cost in missed work and nothing worse. If the answer is "open, with the exit logic living in the part that just went down", that is a completely different category of problem, and it is the one that ends accounts.

That single distinction is worth more than any amount of latency tuning.

What a Few Seconds of Delay Is Actually Worth

Now the number everybody does worry about, priced properly.

To do this honestly I needed a real measure of how fast gold moves, so I took the daily benchmark price series published by the LBMA and measured it. Over the 2,423 trading days in the last ten years, the standard deviation of the daily move is 1.0121 percent.

To turn a daily figure into a per second figure I am using the square root of time convention, which assumes price follows a random walk. That is a standard assumption and it is an assumption, not a fact. Treating a gold trading day as 23 hours, or 82,800 seconds, the standard deviation of a one second interval works out at 0.3517 basis points.

From there, the expected size of the move during your delay, per 10,000 dollars of contract value:

  • Half a second: 0.20 dollars
  • One second: 0.28 dollars
  • Two seconds: 0.40 dollars
  • Five seconds: 0.63 dollars
  • Ten seconds: 0.89 dollars

Ten seconds of delay costs about eighty nine cents per ten thousand dollars of position. Across a hundred trades a year at five seconds of delay, the whole thing comes to roughly 63 dollars.

Two honest caveats. This is the expected size of a random move, so it cuts both ways and is not a pure cost. And it says nothing about the seconds around a major data release, where the move is neither random nor small. But for the ordinary case, which is the great majority of trades, the conclusion holds: latency is a rounding error and downtime is a real number. If your strategy genuinely depends on winning a race measured in seconds, the honest answer is that the edge was never yours to begin with, and a faster bridge will not give it to you.

The Hours Question, and When It Pays Back

Now the part that decides whether to build at all, which is the same calculation you would run on any piece of equipment.

Say running the strategy by hand takes 25 minutes a day, five days a week, 48 weeks a year. That is 100 hours a year of your time. Say building and properly testing the automation takes 40 hours up front, and watching over it, fixing it and adjusting it costs 2 hours a month, or 24 hours a year.

So the machine saves 76 hours a year and costs 40 hours to install. It pays for itself in 6.3 months, and after that it returns about ten working days a year.

I have deliberately counted only hours and not money, because everybody values their own hour differently and putting a rate on it just hides the structure. Run it with your own numbers. If your manual routine takes five minutes a day rather than twenty five, the same 40 hour build takes over three years to pay back, and the correct decision is not to build it.

And one thing the arithmetic does not capture, which cuts against automation: a mistake made by hand is a mistake you are present for. A mistake in a machine repeats, patiently, at full size, until somebody notices. That asymmetry is the real reason the controls in the next section matter more than the code.

Free trading business plan

Get the free REX one page business plan, the sheet where the kill switch, the maximum orders per day and the person responsible for the machine all get written down before it is switched on. One email, no spam, unsubscribe anytime.

Get the free business plan →

The Failure Modes That Cost Real Money

In every one of these systems I have looked at, the damage came from one of four places, and none of them was slowness.

The duplicate order. An alert fires more than once, or a delivery is retried after a response was lost, and the same trade is submitted twice. The position is now twice the size the plan called for, and the risk calculation you did beforehand is void. The fix is that every order carries an identifier the receiving end has seen before and refuses to act on twice.

The orphaned position. The entry gets through, then a link goes down, and the exit instruction never arrives. This is the one that turns 35 hours of downtime into a serious loss, and the fix has nothing to do with the automation: the protective stop goes to the broker with the entry, so it survives everything downstream failing.

The stale assumption. The strategy believes it is flat when it is not, or believes the account holds more than it does, and sizes accordingly. The fix is that the translator reads the actual account state before acting rather than trusting its own memory.

The silent stop. The chain broke on Tuesday and you noticed on Friday, because a system that is doing nothing looks exactly like a system with no signals. The fix is a heartbeat: the machine reports that it is alive on a schedule, and the absence of that report is what alerts you, not the absence of trades.

What an Operator Builds Before Switching It On

None of the following is about the strategy. All of it is about running a machine responsibly, and all of it is written down before the machine is live rather than after the first bad week.

A kill switch you can reach from your phone. One action that stops new orders. If stopping the machine requires a laptop and a login, you do not have a kill switch, you have an intention.

A ceiling on orders per day. A hard limit, enforced in the translator, above which it refuses to act and tells you why. On the day something goes wrong, this is the control that decides whether you lose an afternoon or an account.

Stops placed at the broker, always. Every protective order sits with the counterparty, not in the logic. Everything upstream is allowed to fail without the open position becoming unprotected.

A log you can actually read. Every signal received, every order sent, every response, with timestamps. When something goes wrong at three in the morning, this log is the difference between knowing what happened and guessing.

A month on a demo account first. Not to see whether the strategy is profitable, which a month cannot tell you, but to see how the machine behaves across a weekend, a rollover, a data release and a broker maintenance window. All four will happen. You want the first time to be free.

A review date in the calendar. A machine left alone is not maintenance free, it is unsupervised. Put a date on the sheet where you check the log, count the failures and decide whether it still earns its place.

The honest summary of how to automate tradingview strategy execution is this: the plumbing is a weekend, the controls are the actual job, and the number that decides whether it was worth doing is the hours of downtime you were willing to measure before you started rather than after.

Frequently Asked Questions

How to automate tradingview strategy alerts in the simplest way?
An alert on bar close, delivered to a web address you control, translated into a broker instruction by something that checks for duplicates and reads live account state. Whether you rent that middle piece or build it changes who repairs it, not the structure.

Does automation make my strategy more profitable?
No. It removes the time cost of execution and it removes the human hesitation, both good and bad. A strategy without an edge automates into losing money faster and more consistently, which is why the demo month exists.

How much does a slow connection cost me?
Less than almost anybody expects. On the LBMA gold volatility measured over 2,423 days, ten seconds of delay is worth about 0.89 dollars per 10,000 dollars of contract value. Downtime, not delay, is where the money goes.

Should I use alerts on bar close or intrabar?
Bar close, unless you have a specific reason not to. Intrabar alerts can fire, reverse and fire again within one candle, and every one of those becomes an order downstream unless something is explicitly written to stop it.

What is the single most important control?
The protective stop sitting at the broker rather than in your code. It is the one control that keeps working when every other link in the chain is down, which per the arithmetic above is going to be dozens of hours a year.

Where did the numbers in this article come from?
The 1.0121 percent daily standard deviation is my own measurement of the LBMA daily gold benchmark series over the 2,423 trading days to 2 September 2026. The per second figure, the delay costs, the 35.0 and 173.9 hour downtime figures and the 6.3 month payback are all my own arithmetic under the assumptions written out in the text: square root of time scaling, a 23 hour trading day, independent failure of each link, and the stated hours for manual work, build and upkeep. No gold price appears anywhere in this article.

Where REX Fits

REX Trading Signal is free to follow. Daily XAUUSD setups with a stop loss, a reason and a rule, posted live, wins and losses alike, plus an optional Kit for people who want the operating side written down. Nothing here promises a return, because nobody honest can.

This one belongs with the rest of the operations shelf. The one page trading business plan template is the pillar, and the kill switch and daily order ceiling described above belong on that sheet. Can I automate my trading strategy takes the decision from the other end, whether to build at all, where this article assumes you already decided and asks what you are building. How to test an EA on MT5 covers the demo month in detail.

About the author. Rex writes REX Trading Signal. He is interested in the unglamorous half of this business, the ledger, the controls and the review date, on the view that an account survives on its administration long before it survives on its ideas.

Disclaimer: This article is general educational content about the operational design and reliability of automated order routing. It is not financial advice, not investment advice, not a recommendation of any platform, broker or bridge service, and not a solicitation to trade. The daily gold benchmark price series used to measure volatility is published by the LBMA, and every derived figure is my own arithmetic on that series under the assumptions written out in the text, including square root of time scaling, which is a modelling convention rather than a property of markets. Uptime figures are illustrative assumptions, not measurements of any named service. Automated systems can fail in ways that manual trading does not, and a machine repeats a mistake at full size. Trading gold, CFDs and leveraged products carries a high risk of losing money rapidly, and no entry, stop or target discussed should be treated as a signal. Readers should consider their own circumstances and speak to a licensed professional in their jurisdiction.

The controls are the job. The plumbing is a weekend.

Daily XAUUSD setups with a stop loss, a reason, and a rule, posted live on Telegram, wins and losses alike.

Follow REX Trading Signal → Free to follow. No pressure, no countdown, stay as long as it earns your trust.

More from the journal

REX·TRADING

Risk disclosure. Trading gold (XAUUSD) and other leveraged products involves substantial risk of loss and is not suitable for every investor. Past performance, including any results shared on this site or on Telegram, does not guarantee future results. Nothing here is financial advice; it is personal experience shared for education. Never trade money you cannot afford to lose.

© 2026 REX Trading Signal · Telegram: @REXTradingSignal · Personal views, for reference only.