10 min
You might have heard about traders automating their strategies and wondered how exactly they do it. Automated trading is less exotic than it sounds. A set of rules you could write out on paper gets translated into code, and the code places the orders instead of you.
Author

Updated October 23, 2026
You might have heard about traders automating their strategies and wondered how exactly they do it. Automated trading is less exotic than it sounds. A set of rules you could write out on paper gets translated into code, and the code places the orders instead of you.
Automated trading has become widespread, accounting for 60-73% of all US equity trades. That share explains why the subject keeps coming up. Below is how these systems get built, where they break, and how to avoid the usual traps in trading code.
Automated trading (also called “algorithmic trading”) involves using a computer program to place trades; the program is given rules for when to enter and exit positions and what position size to trade. Successful automated traders are skilled in both programming and developing and testing trading strategies.
Automated trading involves creating trading strategies for financial markets that are based on specific rules. Generating and coding those rules can be simple or difficult, depending on the complexity of the strategy.
Automated trades must be planned according to simple rules and parameters that a computer can understand. For example, a simple automated strategy could specify to buy 100 shares of stock when the daily closing price moves above the 100-day moving average.
That means the program would automatically sell the 100 shares when the stock crosses below and has a daily close below the 100-day moving average.

Successful automated traders
The more complex the system, the harder it will be to code all the rules. For example, human traders can identify a triangle chart pattern quite quickly. You could then tell a human to buy when the price moves above the triangle. A computer, on the other hand, doesn’t know what a triangle looks like unless you tell it via rules.
To automate a triangle trading system, you would need to tell it how far the price moves (uptrend or downtrend), what that move looks like, and on what time frame, before the triangle forms. Then you would need to specify that price waves are getting smaller which creates the triangle-like appearance.
There also need to be time or lookback constraints, so the computer knows to look for chart patterns over the last month rather than the last decade. Nothing is wrong with building something more complex. The coding skill required simply climbs with it.
The coded program is then linked to a broker so that the computer can execute trades through the broker, similarly to what a person would do.
Connecting software to a broker is straightforward on most automated trading platforms, including MetaTrader 4, ThinkorSwim, NinjaTrader, TradingView and others. In most cases you write the code inside the platform, then run it against your account.
A key component of automated trading is including all the variables and considering as many contingencies are possible when coding a strategy. There are many things you understand and take for granted that a computer doesn’t know to look for.
Here are the questions worth answering before you write a line of code. The list is not exhaustive. It does tend to expose the holes people leave in a first version of a system.
What is the precise event that tells the computer to enter a trade at a specific moment, and only that movement?
What is the precise event that tells the computer to exit a trade?
What order types will be used? Market, limit, stop, stop limit, or other?
What market will the program trade? Are there things it should or shouldn’t trade?
How is position size determined? Will it be via a percentage of the account or a fixed dollar or share amount?
How is risk controlled? Is a stop loss deployed? Where is it placed?
Will your program trade through major news events? There are often extreme volatility and large spreads during such times. You could program rules to either stop trading and exit trades before news, or to capitalize on news.
Will the program run all day or night, or will it only run during certain hours of the day?
What is the price input for the algorithm? Can it trade each tick? Only at the close of a price bar (1, 5, 15-minute, etc.)? Or a combination of these?
How are price moves measured? From swing low to swing high? How are swing highs and lows determined (zigzag indicator may help)?
There is also automated trading software available that allows you to create a program with a list of variables. For example, you pick your asset, time frame, technical indicators, entry method, exit method, position sizing method, and so on. The software compiles this into a code that you can test on historical data to see if it is viable.
You can update and tweak the parameters until they are acceptable to you. These programs are often called Wizards. Keep in mind that Wizards may not include all the variables you need to consider (such as how the algorithm handles trading around news, for example).
There is also the option to manually turn your automated strategy on and off when you want it to trade and when you don’t. This can sometimes save some coding time.
Is manual trading better than automated, or the other way around? Let’s look at the pros and cons of algorithmic trading.
There are several things that make automated trading an attractive option for traders:
The program has no emotions. Program it well and it runs without yours interfering, at least in theory. In practice plenty of people still get stressed over an algorithm's performance and rewrite the code, or switch it off and on when they should not. So emotions still play a role.
You can test the rules for profitability since the rules are well-defined. An automated strategy either works or it doesn’t. Since there is no discretion, the rules produce a profit or they don’t. You can keep tweaking the rules until they do.
Computers execute orders far faster than people do. On any strategy that depends on getting filled at a particular price, that speed is most of the edge.
You can program algorithms for different things, essentially doing the jobs of multiple humans. For example, you could have algorithms trading multiple markets at the same time.
But automated trading isn’t without its downfalls. Here are some disadvantages of automating your trades:
It isn’t hands-off. Things can change in the market, so you need to understand your automated trading strategy and continuously monitor its performance.
If something goes wrong with your software or algorithm, it could mean big losses if it keeps running, you can’t turn it off, or you forgot to program certain variables.
Over-optimization is the classic failure. You tweak a system so hard on historical data that it stops working on anything else, because it is calibrated to that one sample. Since most traders want the biggest profits possible, this problem shows up almost everywhere.
Automated traders need to be able to code and develop trading strategies. These are separate skills, each taking time to learn. Simply learning to manually trade (and not learning coding) is a quicker path to trading success.

How Automated Trading Works
There are loads of scams around automated trading and so-called trading robots. Treat every one of them as a sales pitch until the seller proves otherwise.
Nearly all robots and “expert advisors” you see being sold online for a few hundred or few thousand dollars won’t be around a year from now. Your money will vanish, and likely the robot will have also lost all your money in your account.
Why? Because of over-optimization. People build robots, backtest it, and get it to produce fantastic results on past price data. The robot is then sold as a way for you to make quick money. The problem is that it typically doesn’t work on live, real-time market data. The only person making quick money is the robot-seller.
Beware anything that promises great returns with little work. Remember, it is not only the upfront cost of the robot you are paying for. If you give it access to your trading account, it could do much greater damage there.
Take the simple system from earlier. Buy 100 shares when the daily close crosses above the 100-day average, sell when it closes below. On paper that is a single sentence. In code it is at least six separate decisions.
Which close counts, the official settlement price or the last print? What happens if the cross lands on a day the stock is halted? Do you buy at the close that produced the signal, or at the next open? What if the account cannot fund 100 shares that day? Does the system re-enter when price crosses back two days later? And what does it do on a gap that opens above the average without ever crossing it?
Answer those six and you have a specification. Skip one and the platform will answer it for you, usually in whichever way costs the most.
Start smaller than feels worthwhile. Code one rule. Test it on data the system never saw while you were tuning it, then run it on a demo account for a few weeks. Watch what it does around the open, around scheduled news, and on the days you would have skipped by hand.
Execution quality decides a large part of the result, and that is a broker question rather than a coding one. Check which platforms the automation actually runs on, what a round turn costs in commission, and whether the API has a rate limit your strategy will hit within a month. Our broker comparison lists those details, and the shortlist of regulated brokers narrows the field before you start. Compare execution costs before you connect an algorithm to a live account.
A computer program that places trades from rules you define: when to enter, when to exit and what size to trade. The rules have to be precise enough that software can follow them without judgement.
The same way it always has. You code entry, exit, sizing and risk rules, link the program to a broker through a platform such as MetaTrader or NinjaTrader, and it sends the orders. Only the tooling has got easier.
Over-optimizing on historical data, leaving contingencies uncoded, and treating the system as hands-off. Markets shift, software fails, and an algorithm nobody is watching keeps trading right through both.
It demands two skills at once, coding and strategy development, and each takes time. Learning to trade manually first is the faster route. Automation is worth adding once you already have a rule set that works.
Find Your Perfect Broker: Explore Our List Now!
Choose the best with our expert-selected options
Find Your Perfect Broker: Explore Our List Now!
Choose the best with our expert-selected options
Discover top binary options brokers tailored to your region. Browse our curated lists by country:
2002