Trading styles

What Is Algo Trading? How Algorithmic Trading Works

YO
Last updated:

Algo trading, short for algorithmic trading, is the use of software that places and manages trades according to rules set in advance. The rules can cover entries, exits and position size, and the software applies them the same way every time. It is not a guarantee of profit; results depend on the rules, the testing and the market.

Algo trading, or algorithmic trading, means a computer program places and manages trades from rules written before the trade happens. A rule might say buy when price closes above a moving average, with the exit and the size fixed in advance. Traders use algo trading to remove on-the-spot decisions, to run the same logic across many markets and to test an idea on past prices before risking money on it. The approach has real limits. A rule is only as sound as the thinking behind it, and software will carry out a weak rule as faithfully as a strong one. This guide explains how algo trading works, how automated rules are tested and where they tend to fail. It also covers the automation rules that apply to Yo Pips accounts.

What algo trading means

A trading algorithm is a fixed set of instructions. Each instruction tests a condition and then acts on it. Take a simple trend rule: if the fast moving average crosses above the slow one, open a long position; if it crosses back below, close it. The software checks the condition on every new price update and sends the order the moment the condition is true.

Algo trading covers a range of set-ups. At one end, a program runs the whole cycle with no human input once it is switched on. At the other, a tool sends an order only when a person has set the level, time and size in advance. Both are rule-based. What defines them is that the rule, not a judgement made in the moment, decides the action. A chart pattern you read by eye and then trade by hand is discretionary, even when the trader is disciplined.

How a rule becomes an order

Most rule-based systems have the same five parts, whatever the market or the platform:

  1. Data in. The program reads prices, timestamps, volume or indicator values from the feed.
  2. Entry condition. A test that decides whether a trade should open, and in which direction.
  3. Exit conditions. A stop loss, a target and any rule that closes the trade early, such as a time limit.
  4. Position size. A formula that turns the risk you accept into a lot size, so the trade size follows the stop rather than a guess.
  5. Risk checks and order send. Limits on daily loss, open exposure and order count that must pass before the order goes to the broker.

Leaving out any one of these is a common source of trouble. A strong entry with no exit rule, or an exit that moves each time price moves, is not a system. It is a set of hopes.

Manual and automated trading compared

The table compares the two approaches in general terms. It is not a claim that one always beats the other.

QuestionManual tradingAlgo trading
Who makes each decisionThe trader, at the moment of the tradeThe code, from rules written in advance
ConsistencyVaries with attention, mood and fatigueApplies the same rule every time its conditions are met
SpeedLimited by how fast a person can read and actLimited by the platform, the connection and the broker
TestingHard to reproduce exactly what was doneCan be backtested and rerun on the same data
Main riskEmotional or inconsistent decisionsCoding errors, weak rules and overfitting

Expert advisors on MetaTrader 5

MetaTrader 5 (MT5) is a trading platform that lets users write automated programs in its own language, MQL5. These programs are often called expert advisors, or EAs. An EA can read market data, open and modify trades and close them, all inside the terminal. Indicators are a separate kind of program. They draw information on a chart and do not place trades on their own.

Yo Pips accounts run on MetaTrader 5. The rules page sets out which automated tools are allowed, and the platforms page explains how the trading environment is set up.

Worked example: a rule that sizes its own trades

Position sizing is the part of an algorithm that most often decides whether it survives. Here is one rule written as code logic, with hypothetical numbers.

Assume a $10,000 account. The rule risks 1% per trade, so the amount at risk is $10,000 x 1% = $100. The stop loss is 20 pips. On this pair one pip is worth $10 per standard lot. The loss at the stop for one lot is 20 x $10 = $200. Lot size is $100 / $200 = 0.50 lots. The illustration in the figure below uses a different hypothetical rule, a fixed 0.10-lot order, so the two examples are not the same trade.

The rule uses the same formula on every trade. If the next signal needs a 40-pip stop, the same rule gives $100 / (40 x $10) = 0.25 lots. The program does not get bolder after a winning day or more reckless after a losing one, unless the code says so. Spread, commission and slippage are not in this formula, so the real loss on a stopped trade can be a little larger than $100.

The example shows the arithmetic only. It says nothing about whether the entry works, and a correct formula cannot repair a weak entry. If you trade by hand, the same logic applies, and our position size calculator guide works through it step by step.

Four cards in a row show the algo trading cycle: write rules, backtest on past price data, execute as software sends orders, and monitor logs and pause if the rules fail. Below them, a panel labelled EXAMPLE shows a hypothetical rule: if price closes above its 20-bar average, buy 0.10 lots, with a stop 20 pips below entry and a target 40 pips above, a 1 to 2 risk to reward ratio. The panel is marked as illustrative only.
The algo trading cycle, with a hypothetical EXAMPLE rule. Illustrative only, not a strategy or a profit promise. Tap the diagram to view it full size.

Testing: backtests, demo runs and forward tests

A rule should earn trust before it earns money. Three steps are common. A backtest runs the rules over historical price data and records each simulated trade. A demo or forward test runs the live rules on current prices in a simulated account, so you can see how the program handles real spreads, news spikes and connection problems. A small live test comes last, with size kept low.

A backtest is a record of what the rules would have done in the past. It is not a forecast. Several things make backtests look better than live results:

  • Overfitting, also called curve fitting. Rules are tuned until they fit past noise. Each extra setting adds another chance of fitting the past by accident.
  • Look-ahead bias. A rule uses a value that was not known at the time, such as a bar’s final high, before that bar has closed.
  • Missing costs. Spread, commission and slippage are left out or set to zero.
  • Small samples. A handful of trades can show a pleasing curve purely by chance.

A practical habit is to split the data. Build the rule on one period, then test it unchanged on a later period it has not seen. If the result falls apart, the rule was probably fitted to the first period rather than to a lasting pattern.

Where algo trading goes wrong

Most failures are not dramatic. They come from a small number of predictable causes, and a careful builder checks for each one.

  • Bugs in the code. A wrong decimal, a missing condition or a duplicate order can repeat many times before anyone notices. Test the order logic on a demo account first.
  • Connection and platform failures. An open trade can stay open with no one managing it if the terminal disconnects. Know what your program does when it cannot reach the server.
  • No stop switch. Without a kill switch, a broken program keeps trading. Build one that stops new orders at a set loss, well inside any firm limit.
  • Editing rules after losses. Changing settings mid-run to chase recent results makes the record meaningless.
  • Treating a backtest as a promise. Past results do not guarantee future results, and a system can lose money in conditions it never saw during testing.

Yo Pips rules for automated trading

The points below come from the Yo Pips rules page. Checkout terms take precedence over it, and rules can change, so check the rules page before you buy or deploy an automated program.

  • Expert advisors and indicators are allowed unless they break a prohibited-practice rule.
  • Latency arbitrage is prohibited.
  • Feed-delay exploitation is prohibited.
  • High-frequency or feed-delay exploitation is prohibited. For high-frequency trading itself, the rules page and the rulebook word the rule differently, so check the current rules page.
  • Account or device sharing, and strategies built to exploit the simulated environment, are prohibited.
  • Overnight holding is allowed.

For scalping, news trading, weekend holding, hedging and copy trading, check the current rules page. This guide does not summarise those permissions, and they are the points where the rulebook must be read in full.

Two daily rules matter most for automation. The daily loss limit counts closed profit and loss, floating profit and loss, commissions and swaps for the current day. An EA’s open losing trade therefore counts as soon as it loses. Daily figures reset at UTC, so any schedule your code uses for a daily stop must run on UTC, not on local time. A breach is immediate and closes the account. Set your stop switch to act well before the firm limit, not at it. The rules and regulations page has the full definitions, and our prop firm challenge guide shows how the limits fit together across an evaluation.

Frequently asked questions

Is algo trading the same as algorithmic trading?

Yes. Algo trading is the short form of algorithmic trading. Both terms describe trading in which predefined rules, applied by software, decide when to open, manage and close positions. The words describe the method, not the quality of any particular rule set.

Does algo trading guarantee a profit?

No. An algorithm can lose money, including after a strong backtest. Results depend on the rules, the costs, the market conditions and how well the code was tested. Automation removes some human errors, but it does not remove trading risk, and no rule set should be treated as a promise of profit.

Are expert advisors allowed on Yo Pips?

The Yo Pips rules page says expert advisors and indicators are allowed unless they break a prohibited-practice rule. Prohibited practices include latency arbitrage, exploiting price-feed delay and strategies built to exploit the simulated environment. Check the rules page for the full list before you run any automated program on a Yo Pips account.

What is a backtest?

A backtest runs a set of trading rules over past price data and records each simulated trade. It shows how the rules would have behaved on that data, using the costs you entered. It cannot show how the same rules will behave in the future, and results can look much better than live trading if costs or timing were modelled poorly.

What is overfitting in algo trading?

Overfitting happens when a rule is tuned until it fits the noise in past prices rather than a lasting pattern. The backtest looks strong, but the rule often fails on new data. Testing on a period the rule was not built on, and keeping the number of settings small, reduces the risk.

Do I need to code to use algo trading?

Not always, but a custom expert advisor on MetaTrader 5 is written in MQL5, so building one takes programming skill. Ready-made programs also exist. Treat any program you did not write with caution: read its logic, test it on a demo account and check what it does when the connection fails.

Risk disclosure: Trading leveraged products such as forex and CFDs carries a high level of risk, and most traders lose money. Prop firm challenges are evaluations on simulated accounts; passing one does not guarantee account activation, profits or a payout. Nothing on this page is investment advice. Always read the current rules and terms before you buy or start a challenge.