What is Algorithmic Trading?

Updated November 28, 2026

Algorithmic trading is using computer programs that follow set rules to place trades automatically.

Want Your Money Working While You Sleep?

Get our free guide to letting AI trade for you, 5 minutes a day.


No spam. Unsubscribe anytime.

Algo trading is the bigger umbrella over bots and EAs. A set of rules gets turned into code.

Big banks and funds do it at huge speed. Regular people can use simpler versions on MetaTrader or through platforms.

An algorithm is only as good as its rules. Markets change, so even a strong algo can hit rough patches.

In practice, algorithmic trading turns a trading plan into exact instructions a computer can follow. The rules cover when to enter, how large a position to take, where to place the stop loss and when to exit. A human can follow a checklist too, but a program can watch many markets at once and apply the same rules without getting tired or emotional. Banks and funds use it at huge scale.

Here is a worked example. Your rule is to buy when the 20 period moving average crosses above the 50, using a 40 pip stop and an 80 pip target at 0.05 lots. Each trade risks about $20 to aim for $40. With a 1 to 2 ratio, the strategy needs to win just over one trade in three to break even before costs. Spreads and commissions raise that bar a little.

A common beginner mistake is overfitting. That means tuning rules until they look perfect on old data, only to find they fail in live markets because they matched past noise. Adding more conditions usually makes a backtest look better, and it can make live trading worse. Simple rules tested across several market periods, then checked on data the rules never saw, tend to give a more honest picture.

Algorithmic trading is the broad practice, and trading bots and expert advisors are the tools that carry it out. Backtesting checks the rules on history, and forward testing checks them in real time. AI trading is one branch where a model helps form the rules. Costs matter here too, because a program that trades frequently pays the spread and commission on every single order.

Example

A rule says buy when the 20 moving average crosses above the 50, and the program does it every time.

Primary Sources For This TopicWe check facts on this topic against these primary sources. See how we research.

Questions people ask

Do I need to code?

Not anymore. Many tools let you build or rent strategies without coding.

Is algo trading risky?

Yes. It removes emotion, not risk.

What language are algorithms written in?

On MetaTrader, MQL4 and MQL5 are the standard. Python is also popular for research and for connecting to brokers through their APIs.

Is algorithmic trading legal?

Generally yes for retail traders, and many brokers support it. Some ban specific practices such as abusing price feeds, so read your broker's terms before running a strategy.

Work out your own number with the quit your job calculator, or take the passive income quiz.

All guides · Answers · Glossary · Compare · Web stories · Wallpapers · Privacy · Terms