Ready to go further
Next: size a trade from your stop
Enter your balance, the percent you will risk and the stop distance in pips to see the lot a forex EA should use.
What is included
- How the bot works, step by step
- The arithmetic of the ladder or grid, with tables
- How it fails and how to test it honestly
- The tools that check the numbers
Who it is for
- People thinking of using this kind of bot
- People already running one and wanting a stress test
- Readers comparing bot types before buying
- Not advice, and not a recommendation to use one
Key facts
- A forex EA is a program that watches currency prices on a trading platform and places, moves and closes orders by fixed rules. This page covers its daily loop and its parts. The page on the expert advisor covers lot size and risk.
- Most EAs run the same loop on every new price or bar: read data, check the rules, check the account, send or change an order, then wait.
- Costs decide many EAs. In the made-up example below a gross edge of 2.50 pips a trade is gone when costs reach 2.50 pips a trade (calculated by us on 29 Oct 2026, exact).
- A test must show the number of trades, the costs used, the worst drawdown and what happened on data the settings never saw.
- EAs fail through costs, tuning to old data, ladders that grow losses, and the machine or connection going off.
What a forex EA does day to day
An EA is attached to a chart of one currency pair and one time frame. From then on it runs the same cycle again and again. Many EAs run it on every new price tick. Others wait for a bar to close, which is calmer and easier to test.
- Read. It gets the latest prices, the indicator values it needs, the time and the state of the account.
- Decide. It tests its entry rules. If a trade is open it tests its exit and management rules too, such as moving a stop.
- Check. It checks the guard rules: the spread is not too wide, it is inside its allowed hours, it has not hit its daily loss limit, and the margin is enough.
- Act. It sends an order, changes one or closes one. The broker may fill it at a different price from the one it saw. That gap is slippage.
- Record. It writes a line to the platform log. That log is how you learn what it did and why.
Most of the time an EA does nothing. A bar closes, the rules say no, and it waits. A quiet log is normal. A silent EA is a different matter, and installing an EA lists the reasons one does nothing at all.
The parts of an EA
Every EA, however it was made, has the same five parts. Knowing them lets you ask the right question about any EA you read about.
- The signal. The rule that says enter. A moving average cross, a breakout of a range, a level of an indicator.
- The filter. The conditions that stop the signal acting: wide spread, news time, a quiet session.
- The sizing. How big each trade is. A fixed lot, a percent of the account, or a lot that grows after losses. This part sets the real risk, as the expert advisor page shows.
- The exits. A stop loss, a take profit, a trailing rule, a time limit. Without a stop, the worst case has no limit.
- The guards. Daily loss limit, maximum open trades, a switch that stops it all. These are the parts that matter on the worst day.
What a test of an EA must show
A picture of a rising line is not a test. A test of an EA is a list of facts, and each one can be checked. The backtesting page gives the steps. For an EA the list is:
- The period and the pair, and how many trades it made. A hundred or two trades is a small sample, and the result can move a lot with a few trades.
- The costs used: spread, commission, swap and some slippage. A test with none of them describes a market that does not exist.
- The worst drawdown, as a percent of the account, and how long it lasted.
- The largest position the EA ever held and the largest single loss.
- A result on data the settings were never tuned on, which is the point of forward testing.
Worked example: the same EA, five cost levels
This is a made-up EA, not a real one. Over 200 trades, 45 percent win 30 pips and 55.00000000000001 percent lose 20 pips. The gross result per trade, before any cost, is the sum of each outcome times its chance.
Now take off a made-up cost per trade, which stands for spread and commission together. The same 200 trades give very different results.
| Cost a trade (pips) | Net per trade (pips) | Net over 200 trades (pips) | Cost paid over 200 trades (pips) |
|---|---|---|---|
| 0.0 | 2.50 | 500 | 0 |
| 0.5 | 2.00 | 400 | 100 |
| 1.5 | 1.00 | 200 | 300 |
| 2.0 | 0.50 | 100 | 400 |
| 2.5 | 0.00 | 0 | 500 |
At 0.0 pips a trade the EA shows 500 pips. At 2.0 it shows -100. At 2.5 it shows -300, so the whole edge is paid out as costs. Nothing about the signal changed. Only the cost line did. This is why a test with no costs, or costs lower than the real ones, can make a weak EA look strong. The spread page shows how wide a spread can get at quiet or busy times.
How forex EAs fail
- Costs larger than the edge. As the table shows, a small edge and a frequent trader are a poor mix. The costs are the one sure thing in the test.
- Tuning to the past. An EA with many settings can be adjusted until the old data looks smooth. That is overfitting, and the live result is then usually worse than the test.
- Look-ahead in the code. A rule that quietly reads a bar that was not closed yet gives great tests and no live trades like them. See look-ahead bias.
- Ladders. An EA that adds to losers or doubles its lot wins often and loses rarely and large. The martingale page shows the exposure.
- Changed conditions. Spreads widen at rollover and around news. A market that trended can start to range. The rules do not adapt unless they were written to.
- The machine goes off. A sleeping laptop or a lost connection leaves open trades unmanaged. Stops held on the broker's server help. A rented always-on machine is covered under forex VPS.
- Trusting the settings of someone else. A lot size chosen for another person's account is not yours.
What this page does not tell you
It does not say any forex EA makes money, or that none do. All numbers above are made up. It describes the parts and the checks, not any named product, and your platform, pair and costs will differ.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What does a forex EA actually do?
It runs a loop on a chart: it reads prices, tests its rules, checks its guards and then places, moves or closes orders. Most of the time the rules say no and it does nothing.
How is this different from the expert advisor page?
That page is about what an EA is and how lot size sets its risk. This one is about the daily loop, the five parts and what a test must show.
What are the parts of an EA?
A signal, a filter, the sizing, the exits and the guards. The sizing and the guards decide how bad the worst day can be.
What should a test of an EA show?
The period, the number of trades, the costs used, the worst drawdown, the largest position and a result on data the settings never saw. A rising line alone shows none of these.
Why do costs matter so much?
They are paid on every trade, win or lose. A small edge per trade is easily used up, as the made-up table shows.
Are the numbers on this page real?
Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.
Can I use this to decide whether to run a bot?
It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.
Is this financial advice?
No. It is general education. The numbers are made up and your platform, pair and costs will differ.
Know the Risk Before You Run It
Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.
Trading carries a risk of loss