Skip to content

Trading robots and automated systems

Staying safe and your rights

Trading robots and automated systems

A program attached to a chart does one thing. It evaluates a list of conditions against every price the platform hands it, and when the conditions are all true it submits an order. It exercises no judgement at the moment it acts, because every judgement it contains was made in advance by whoever wrote the list. What automation replaces is the pressing of the button, not the thinking behind it.

7 min read, Reviewed

What you will be able to do

  • Explain what an automated system executes and what it does not decide
  • Explain why a purchased system's historical results cannot be independently verified
  • Describe the execution risks specific to unattended automation
  • Explain the difference between writing a rule set and buying one

What the program actually does 

An automated system is software running inside a trading terminal with permission to place, modify and close orders on an account. The names differ by platform and by seller: expert advisor, robot, bot, algorithm, strategy, script. The object underneath the name is the same in every case, a list of conditional instructions executed over and over on data the terminal is already receiving. The platforms in use at YAL are MetaTrader 5, and both support programs of this kind, as most retail platforms do.

An instruction list has three kinds of line in it, and only the third leaves the machine. There are conditions to evaluate, such as whether a shorter moving average has crossed a longer one on the bar that just closed. There is state to check, such as whether a position is already open or how much free margin the account is carrying. And there is an action to submit, an order of a stated size with whatever attached instructions the writer specified. Everything the program knows is a number the platform gave it. It has no access to why a price moved, no knowledge that an announcement is due unless a line was written to look one up, and no capacity to notice that the market stopped behaving the way it did when the conditions were chosen.

Key term

Systematic trading
Systematic trading follows rules fixed in advance for entry, size and exit, so the same market data produces the same decisions whoever is watching the screen and however they feel about it.

Key term

Automated trading
Trading in which software places the orders directly, so a rule that has been coded and switched on acts on the market without a person confirming each instruction.

That is the whole of what automation changes. A decision a person would take in the moment is written down in advance and then executed without further consideration. Consistency and speed are what the machine contributes: it does not hesitate, it does not miss a condition it was told to watch, and it does not depart from the list. It also does not depart from the list on the occasions when departing would have been the sensible thing, because sensible is not a category available to it.

The rules are the product 

When a rule set is written, the rules are the thing that exists and they are visible to whoever wrote them. When one is bought, what changes hands is ordinarily a compiled file, a document describing how the rules would have behaved across some stretch of past prices, and a price. The rules themselves are usually withheld, and the reason given is commercially real: disclosure would let a buyer reproduce them without paying. It also removes the only part of the product that could have been examined.

A simulation over historical data is an arithmetic exercise rather than a record. It takes a rule set, walks it across a stored series of prices, and reports what the rules would have instructed at each point. No order reaches a market, no money moves, and nothing in the process is observed by anyone other than the party running it. Its output depends entirely on choices that party made: which instrument, which stretch of history, what cost per trade was assumed, whether an order was assumed to fill at the price on the screen, and whether the parameters were fixed before the walk or chosen after it. The last of those does the most work, and it has a name.

Key term

Overfitting
Overfitting is shaping a rule until it describes the particular record it was developed on, including the parts of that record produced by chance, which is why the result does not survive new data.

Overfitting is what happens when a rule set is adjusted until it describes one particular stretch of history closely. Every rule set has parameters, the lengths, thresholds and distances that turn a general idea into an exact instruction, and each can be varied. A search across the combinations will always find one that fits the data it searched, because a large enough search finds a fit in any series, including a series of random numbers with no market in it at all. What the winning combination certainly describes is the search. Whether it describes anything else is the open question, and the document reporting it cannot answer that.

Worked example. Illustrative figures, not YAL prices or terms.

How large a parameter search gets

Parameters in the rule set
4
Candidate values tried for each parameter
20
Combinations the search evaluates
20 × 20 × 20 × 20 = 160,000
Combinations carried into the document
1, the one that ranked highest
Combinations the document usually mentions
0
Years of price history the search ran over
5
Years held back from the search
0, in the common case

The parameter and value counts are assumptions chosen to keep the multiplication legible, and they describe no particular product. The arithmetic is the point: what a document reports is the best of one hundred and sixty thousand attempts on the same five years, and reporting the winner without reporting the size of the search omits the number that determines how much the winner means. Costs are absent from this block and are the subject of the one below.

What a simulation assumes away 

The second gap between a simulation and an account is cost, and it is arithmetic rather than opinion. A walk across stored prices has to assume something about what each round trip costs, and whatever it assumes is multiplied by however many round trips the rules generate. Frequency is what multiplies the assumption fastest, and frequently trading rule sets are common, because frequency is also what makes a short stretch of history long enough to summarise.

Worked example. Illustrative figures, not YAL prices or terms.

An assumed cost, multiplied by frequency

Contract size assumed
100,000 units of the first currency in the pair
Value of one pip on that contract size
10.00
All in cost assumed per round trip
1.0 pip, so 10.00
Round trips per trading day
8
Trading days in the month
20
Round trips in the month
160
Cost over the month at the assumption above
1,600.00
Cost over the month if the true cost is 0.5 pip
800.00
Cost over the month if the true cost is 2.0 pips
3,200.00

Every figure here is an assumption chosen for legibility. None of them is a YAL cost or a YAL term, and the pip value shown holds only for a contract quoted in the account's own currency. The block computes a cost line and nothing else: it states no profit, no loss and no outcome for any rule set. What it shows is that the line scales with the number of trades rather than with anything the rules are doing, and that the fourfold difference between the last two cases comes entirely from an assumption a buyer cannot inspect. Financing adjustments and any difference between the price a simulation assumed and the price an order filled at are excluded throughout.

Fills are the other omission, and they compound the first. A simulation reads a stored price and books the trade there. A live order goes into a market that is moving, at a moment when the price on the screen may no longer be the price available, and the gap between the two is widest in exactly the fast conditions a frequently trading rule set fires in. Practitioners treat that gap as a major source of divergence between a document and an account, and disagree about how much of it can be modelled in advance.

None of this establishes that a sold rule set is dishonest. It establishes something narrower and harder to get around: the document accompanying it cannot be falsified by the person reading it. The data, the cost assumption, the fill assumption, the size of the parameter search and whether the rules in the file are the rules that were walked all sit with the seller.

What breaks when nobody is watching 

A program that runs while nobody is at the machine carries a set of failures that a person clicking manually does not, and they are mechanical rather than strategic. The rules can be entirely as intended and every one of these can still occur.

  • The program only runs while the terminal it lives in is running and connected. A closed laptop, a dropped connection or an update that restarts the machine stops the program, and any position it opened stays open regardless.
  • After a break in connectivity, the program's record of what is open and the account's record can disagree, so an instruction can be submitted twice or a close can be missed entirely.
  • A gap over a weekend or through a scheduled announcement moves price past the level at which an attached instruction was set, and the position closes at whatever is available rather than at the level specified.
  • If free margin fails its requirement overnight, positions are closed by the counterparty on the counterparty's terms and in the counterparty's order, which is not the order the rules would have chosen.
  • A rule set written for one instrument on one timeframe evaluates identically on any chart it is attached to. The conditions still compute, and they no longer mean what they meant.
  • A size, a threshold or a decimal point typed wrong is executed exactly as typed, at whatever frequency the rules fire, until somebody notices.
  • The program has no access to any fact about the world that has not been reduced to a number in its feed. A halted instrument, an unusual quote and an ordinary quiet morning are indistinguishable to it.

Key term

Market risk
Market risk is the exposure to loss from prices moving, the one risk that remains after credit, liquidity and operational risks have been separated out.
Running a program on a rented server rather than a personal machine removes some of the failures above and none of the rest. Continuous power and connectivity address the machine. They do nothing about a rule set that is wrong, a market that gaps, a margin close out or an instruction repeated after a reconnection.

Who is selling, and what a licence covers here 

A vendor of trading software is ordinarily not a regulated party in any of this. An authorisation covers a firm that deals, holds client money and faces a client on a contract. Writing a program and selling it as a file is, in most regimes, not an activity requiring a permission at all, so the register check taught earlier in this module has nothing to find, and an absent entry is not a finding either way. What follows is narrower and worth stating plainly: the protections that attach to a regulated relationship attach to the broker relationship, and they do not travel to the sale of a file by somebody else.

Key term

Know your customer (KYC)
Know your customer names the identity verification and ongoing due diligence that anti money laundering law requires a regulated firm to complete before opening an account and to repeat afterwards.

One variation appears often enough beside the sale to be worth marking. Instead of selling the file, a seller offers to run the program on the buyer's own account, which requires access to that account rather than a download. That is a different arrangement with a different set of questions, and it is the subject of the next lesson.

Writing a rule set and buying one 

The difference between the two is not skill and it is not sophistication. It is visibility. A rule set written by hand comes with its assumptions attached: which conditions were chosen and which were discarded, how many parameter combinations were tried and over what stretch, what cost was assumed, what the program does when a connection drops. A bought rule set comes with a file and a claim, and there is no route from the second to the first. The two can behave identically on a chart and remain entirely different products in every respect that could be inspected.

The intermediate cases follow the same logic. A program distributed with its source readable is inspectable whatever else is true of it. A description of the rules in plain language is inspectable only to the extent that it matches the file, which is itself unverifiable when the file is compiled. A demo account, covered in an earlier module, runs against the same platform mechanics without money at stake, so it is where the plumbing of a program becomes observable: whether it fires when the conditions are met, what it does across a rollover, how it recovers from a restart. What a demo cannot show is cost and fills on a live account, which is the pair the document was already silent about.

Where practitioners disagree 

The first argument concerns what automation actually removes. One tradition holds that a written rule executed by a machine removes the moment of hesitation and the improvisation that follows it, because the machine has no opinion about the last loss. The other answers that discretion is relocated rather than removed, to the person who decides when the program is switched on, switched off, restarted with different parameters or abandoned. A rule set turned off after a difficult run and turned on again after a calm one is being traded discretionarily with extra steps. Both descriptions are accurate about different parts of the same arrangement, which is why the argument persists.

The second concerns whether holding data back settles the fitting problem. The convention is to search parameters on one stretch of history and then check the chosen combination against a stretch that was withheld. Critics point out that once a rule set has been revised in the light of what the withheld stretch showed, that stretch has been searched too, and in practice most rule sets are revised. There is also no test that separates a rule set that stopped fitting because the market changed from one that never fitted anything except its own search.

The third concerns disclosure. Sellers argue that rules published widely enough stop working, because a condition many participants act on at once changes the thing it is watching. Others answer that most retail rule sets are long standing conventions with different numbers in them, described in public for decades, and that non disclosure guards the sale rather than the rules. Neither side disputes the part that matters to a buyer: an undisclosed file cannot be checked by the person paying for it.

Trading CFDs and leveraged products involves a significant risk of loss and is not suitable for all investors. You could lose more than your initial investment. Ensure you fully understand the risks and seek independent advice if necessary.

In summary 

  • An automated system executes a list of conditions and submits orders. It decides nothing at the moment it acts, and every judgement inside it was made in advance by whoever wrote the list.
  • A document describing how a rule set would have behaved over past prices is an arithmetic exercise, not a record. The parameter search behind it, the cost assumed, the fills assumed and whether the file contains the rules that were walked are all held by the seller and are not visible from outside.
  • Unattended running adds mechanical failures that have nothing to do with the rules: a terminal that stops, a connection that drops and duplicates an instruction, a gap through an attached level, a margin close out on the counterparty's terms.
  • Writing a rule set and buying one differ in visibility rather than in sophistication. A written one carries its assumptions with it. A bought one carries a claim, and a vendor of software is ordinarily not the regulated party in the arrangement.

Get started

Open your account in four steps.

A clear path from sign-up to your first trade, in four steps.

No depositNo documents

  1. 01/ 04step 1 of 4

    Register

    A few details to get started.

    No deposit to open

  2. 02/ 04step 2 of 4

    Verify

    Confirm your identity, securely.

    ID and proof of address

  3. 03/ 04step 3 of 4

    Fund

    Add money by bank transfer or card.

    From $0

  4. 04/ 04step 4 of 4

    Trade

    Go live on the platform you already know.

    MetaTrader 5

Cookies on this site

Some cookies are needed to make the site work. With your permission we also use analytics cookies to see which pages are read, so we can improve them. You can change your choice at any time.