Ready to go further
Try your own multiplier and cap
Set a start lot, a multiplier and a step gap and see the step where margin runs short.
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 martingale EA is an expert advisor, a program on a trading platform, that adds a larger position each time price moves a set distance against the last one, then closes the whole basket on a small recovery.
- Its inputs are the start lot, the lot multiplier, the gap between steps, the maximum number of steps and, in a careful design, a hard stop. The tester cannot tell you whether those inputs are safe.
- In a made-up run (start 0.20 lot, multiplier 1.5, 30 pip gap, $5,000.00 account) the floating loss reaches $1,776.00 at step 6, which is 36 percent of the account (calculated by us on 30 Oct 2026, exact).
- A hard stop of $1,500.00 would be crossed at step 6. It turns an open-ended loss into a known one, but it is still a loss.
- A tester usually uses a fixed, narrow spread. Real spread can widen when news lands, which makes closing a big basket cost more than the test showed.
What a martingale EA is
The martingale page explains the idea: after a loss, size up so one win clears the slate. An EA is the form of a trading program that runs inside a retail forex platform. See forex EA for the basics. The martingale bot page covers the stop-and-target form, where each losing trade is closed before the next one opens. Most EAs of the kind on this page work differently. They keep the losing trade open and add another in the same direction when price has moved a set distance further away. When price comes back a little, the whole basket closes together.
The inputs that decide everything
- Start lot. The size of the first order.
- Lot multiplier. How much bigger each new order is than the last. A value of 2 doubles. A value of 1.5 grows more slowly.
- Step gap. How many pips against the last order before the next one opens.
- Max steps. The most orders open at once. Without it the basket grows until the account runs out.
- Hard stop. An equity or loss level at which everything is closed. Many EAs do not have one.
Lots are rounded to the size the platform allows, usually two decimals, so a multiplier of 1.5 does not give exactly 1.5 times at each step. The table uses the rounded sizes.
A worked ladder with made-up numbers
A made-up EA buys 0.20 lot, then adds a bigger buy every 30 pips of fall, with a multiplier of 1.5 and a cap of 6 steps. One pip on one standard lot is worth $10.00. The account is $5,000.00 at 1:30 leverage and a price of 1.1, so margin is about $3,666.67 per standard lot. Each row shows the state when price sits at that step's entry level. "Extra cost to close" is what it adds to close the whole basket if the spread has widened from 1.5 pips to 8 pips. These sizes and spreads are made up, and real values vary by broker and by day.
| Step | New lot | Total lots | Floating loss | Equity | Margin used | Margin level | Extra cost to close, wide spread |
|---|---|---|---|---|---|---|---|
| 1 | 0.20 | 0.20 | $0.00 | $5,000.00 | $733.33 | 682% | $13.00 |
| 2 | 0.30 | 0.50 | $60.00 | $4,940.00 | $1,833.33 | 269% | $32.50 |
| 3 | 0.45 | 0.95 | $210.00 | $4,790.00 | $3,483.33 | 138% | $61.75 |
| 4 | 0.68 | 1.63 | $495.00 | $4,505.00 | $5,976.67 | 75% | $105.95 |
| 5 | 1.01 | 2.64 | $984.00 | $4,016.00 | $9,680.00 | 41% | $171.60 |
| 6 | 1.52 | 4.16 | $1,776.00 | $3,224.00 | $15,253.33 | 21% | $270.40 |
Read the floating loss column. At step 5 it is $984.00. At step 6 it is $1,776.00, past the made-up hard stop of $1,500.00. The loss does not grow in a straight line, because every new order is bigger and sits on a longer slide. The margin level column falls from 682 percent to 21 percent. A broker's margin call and stop-out levels vary, so check yours. The martingale calculator runs other inputs.
What the strategy tester does not show
A test replays old prices through the EA and keeps score. It is useful, and it has blind spots that matter more for a basket EA than for most.
- Spread widening. Many tests use one fixed spread, or the spread recorded at the time. In a fast market the spread can be many times wider for a short while. The last column of the table shows the extra cost of closing a large basket then. A test that missed it overstates the result.
- Margin and stop-out. The tester may show a deep floating loss and keep going. A live account has a stop-out level, set by the broker, at which positions are closed for you. See margin call and stop out.
- Swap. Positions held overnight pay or receive a rate. A basket held for days at large size can pay a lot.
- Short history. A few months of calm prices may never produce the run of steps that matters. A smooth line says little about the one event that ends it. See backtesting and overfitting.
- Tuned inputs. Gap, multiplier and cap can be tuned until the old data looks good. The same inputs on new data often look worse.
The hard stop and its limit
A hard stop closes everything when the loss reaches a set size. In the example it fires by step 6, so the worst case is about $1,776.00 plus the cost of the spread at that moment, not an open-ended slide. That is the one setting that keeps the downside known. It does not make the EA safe. The size of the hard stop is the size of the loss on the days it fires, and on the other days the EA closes for a small gain, so the average depends on how often it fires. The expected value calculator does that sum for a win rate you choose.
How to check a martingale EA before trusting it
- Find the multiplier, the gap, the cap and the hard stop. If one is missing, the worst case is unbounded.
- Work out the floating loss at the cap, as a percent of the account, as in the table.
- Run the test with a wide spread and a low-margin setting, and read the lowest margin level.
- Run it on a demo account for weeks first. See demo account.
Every number on this page is made up. This is education about how the program works, not a view on whether to use one.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is a martingale EA?
It is an expert advisor that adds a larger order each time price moves a set distance against the last one, then closes the whole basket on a small recovery. The size grows with each step.
What does the lot multiplier do?
It sets how much bigger each new order is than the previous one. A higher multiplier recovers faster but grows the open size and the margin used much more quickly.
What is max steps?
The most orders the EA will have open at once. It limits the size of the basket. If it is not set, the basket can grow until the account cannot open the next order.
Why does a hard stop matter?
It closes everything at a set loss, so the worst case is known in advance. Without one, the basket stays open while the loss grows.
What does the strategy tester not show?
Often it misses wide spreads in fast markets, the broker stop-out level, swap on long holds and rare runs of steps that a short history never contained.
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 about how a type of program works. All prices and sizes are made up, and it does not consider your situation.
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