Ready to go further
Put your own ladder through the numbers
Set a start lot, a multiplier and a stop distance and see the step where margin runs out.
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 bot opens a trade, and if that trade is stopped out it opens the next one larger, usually double, so the first win repays every earlier loss plus one starting unit.
- The bot form needs two settings the idea does not: a step cap (the most losing steps in a row it will take) and a lot limit. Both decide how it fails.
- In a made-up ladder starting at 0.01 lot with a 30 pip stop and a 30 pip target, every win nets $3.00, but five losses in a row cost $93.00, the same as 31 wins (calculated by us on 27 Oct 2026, exact).
- On a $1,000.00 account the margin wall arrives at step 6, where the lot size needs more margin than the equity left (made-up leverage 1:30).
- A step cap does not remove the loss. It sets the size of it and turns a slow drain into one large event.
What a martingale bot is
The martingale page explains the idea: after a loss, bet more, so one win clears the slate. A martingale bot is a program that does this on its own. It has a starting lot, a multiplier (2 for doubling), a stop and a target for each trade, and a rule for what happens when a trade is stopped out: open the next one at the multiplied size. When a trade hits its target, the cycle ends and the bot goes back to the starting lot.
The martingale strategy page covers the method. This page covers what a bot adds. A person can stop. A bot with no cap does not. So the step cap and the lot limit are the settings to look at first.
The loss ladder
The made-up bot starts at 0.01 lot and doubles after each stop-out. The stop and the target are each 30 pips, and one pip on one standard lot is worth $10, so 0.01 lot is worth $0.10 a pip and the first stop costs $3.00. The account is $1,000.00 at 1:30 leverage and a price of 1.09, so margin is about $3,633.33 per standard lot. Each row shows what happens if every step up to it is stopped out.
| Step | Lot size | Loss on this step | Total lost so far | Win on this step | Net if it wins | Margin for this step | Equity before it | Margin covered |
|---|---|---|---|---|---|---|---|---|
| 1 | 0.01 | $3.00 | $3.00 | $3.00 | $3.00 | $36.33 | $1,000.00 | Yes |
| 2 | 0.02 | $6.00 | $9.00 | $6.00 | $3.00 | $72.67 | $997.00 | Yes |
| 3 | 0.04 | $12.00 | $21.00 | $12.00 | $3.00 | $145.33 | $991.00 | Yes |
| 4 | 0.08 | $24.00 | $45.00 | $24.00 | $3.00 | $290.67 | $979.00 | Yes |
| 5 | 0.16 | $48.00 | $93.00 | $48.00 | $3.00 | $581.33 | $955.00 | Yes |
| 6 | 0.32 | $96.00 | $189.00 | $96.00 | $3.00 | $1,162.67 | $907.00 | No |
| 7 | 0.64 | $192.00 | $381.00 | $192.00 | $3.00 | $2,325.33 | $811.00 | No |
| 8 | 1.28 | $384.00 | $765.00 | $384.00 | $3.00 | $4,650.67 | $619.00 | No |
| 9 | 2.56 | $768.00 | $1,533.00 | $768.00 | $3.00 | $9,301.33 | $235.00 | No |
| 10 | 5.12 | $1,536.00 | $3,069.00 | $1,536.00 | $3.00 | $18,602.67 | -$533.00 | No |
Read the "Net if it wins" column first. It is $3.00 in every row where the previous steps were stopped. That is the design: a long ladder with a tiny reward. Now read "Total lost so far". Step 5 has cost $93.00, step 8 has cost $765.00 and by step 9 the losses are more than the $1,000.00 account. The last two columns show the margin wall: from step 6 the next lot needs more margin than the account has left, so the platform cannot open it, whatever the bot wants. The exact margin rule varies by broker. The martingale calculator runs your own numbers.
Step caps and the margin wall
A step cap says the bot will take at most this many losing steps in a row. At the cap it stops the cycle, takes the stack of losses and starts again, or stops altogether. A cap of 5 in this example limits one cycle to $93.00, which is 9.3 percent of the account. A cap of 8 limits it to $765.00, 76.5 percent, and a $1,000.00 account cannot open step 6 at all.
The cap is a trade between two failures. A low cap is reached more often. Assume each step has a 50 percent chance, an assumption only, since real moves cluster. Then a cycle ends at the cap with a chance of 0.5 to the power 5, which is 3.125 percent, about 1 in 32. Each cycle that does not reach the cap wins $3.00. The average per cycle is then 0.96875 times $3.00 less 0.03125 times $93.00, which is zero. The wins and the rare loss cancel out exactly, before spread. Spread and swap push it below zero. The expected value calculator does this sum for any win rate.
The margin wall is the other limit. It is not a choice. When the next lot needs more margin than the free equity, the order is rejected, and the bot is stuck holding a loss it planned to recover. If the account is in trouble at that point, the platform can close positions, as described on margin call and stop out.
Why a bot hides the problem in testing
- Most cycles win. With a cap of 5, 96.9 percent of cycles in the example end with a gain of $3.00. A test that runs for a few weeks can show a smooth rising line and never meet the one cycle that ends at the cap.
- Trends make streaks. The coin-flip chance above is the best case. In a real trend, stops are hit one after another, and the streak is longer than chance suggests.
- Costs scale with size. Spread is paid on every step, and the late steps are the large ones.
- A test that ignores the margin wall overstates what the account can take. Check that the test included margin rejections.
How to check a martingale bot
- Find the step cap, the multiplier and the lot limit. If any is missing, the worst case is unlimited.
- Work out the loss at the cap as a percent of the account, as in the table.
- Look for the largest losing run in the test and the lowest margin level, and ask how long the test was.
- Compare with the blow-up tracker to see how often this kind of ladder has ended.
Every number here is made up. We have no tested results of our own for a martingale bot to publish yet.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is a martingale bot?
A bot that opens a larger trade after each loss, usually double, so that the first winner repays all earlier losses and one starting unit. It returns to the starting size after a win.
What is a step cap?
The most losing steps in a row the bot will take. At the cap it stops the ladder and accepts the stack of losses. It sets the size of the worst cycle.
What is the margin wall?
The step where the next lot needs more margin than the account has free. The platform rejects the order and the bot is left holding the loss it meant to recover.
Why does a martingale bot look good in a backtest?
Most cycles end in a small gain, and the rare cap event may not appear in a short test. The smooth line hides the size of the loss it will take when the event comes.
Does a lower multiplier help?
A smaller multiplier grows the stack more slowly and needs more steps to recover, so the ladder is longer. The shape of the risk is the same: small gains often, a large loss rarely.
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 bot 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