Ready to go further
Next: look at the case VaR leaves out
The risk of ruin calculator shows the chance of losing a set share of the account given a win rate and a payoff, which is the question VaR does not answer.
What is included
- What it is, in plain words
- The formula or mechanism, with exact arithmetic
- How it hits grid, martingale and DCA bots
- A check you can run before you switch a bot on
Who it is for
- People who run or plan to run a trading bot
- Anyone reading a backtest or a bot sales page
- Readers who want the numbers, not the pitch
- Not advice, and not a signal service
Key facts
- Value at risk (VaR) is the loss that a portfolio is not expected to exceed over a set period at a set confidence. A one-day 95 percent VaR of $164 means that on 95 days out of 100 the loss should be $164 or less.
- It is silent about the other 5 days. It marks a line and says nothing about how far past it the losses go.
- In the made-up bot record below, the historical 95 percent VaR is zero loss, yet one day lost 10.00 percent and the average of the worst five days was 2.25 percent.
- Normal-curve VaR assumes smooth, symmetrical returns. Martingale, grid and short-volatility bots have lumpy, one-sided returns, so it understates their tail.
- VaR is a measure used by banks and risk teams. It can be a useful input for a bot, but only next to drawdown and the worst case.
What value at risk is
VaR answers one question: how much could be lost in a given time, if the next period is not one of the worst few? You pick two things. The horizon is the period, such as one day. The confidence level is how sure the statement should be, such as 95 percent. The answer is a loss amount.
Read it carefully. A one-day 95 percent VaR of $164 does not say the most you can lose is $164. It says that on a typical day the loss should not be bigger than $164, and that roughly 1 day in 20 it will be. The measure is silent on how much bigger.
Three ways to calculate it
- Parametric (variance-covariance). Assume returns follow a normal curve, estimate their standard deviation, and multiply by a fixed number for the confidence level. Quick and simple. Only as good as the normal assumption.
- Historical. Take a record of past returns, sort them from worst to best, and read off the loss at the chosen percentile. No curve is assumed. It can only see what the record contains.
- Monte Carlo. Simulate many possible paths from a model and read the percentile. It is as good as the model that generates the paths. See the Monte Carlo simulator.
z = 1.2816 at 90 percent, 1.6449 at 95 percent, 2.3263 at 99 percent (standard normal values)
For a longer horizon, the standard deviation is often scaled by the square root of the number of days. That is again an assumption: it holds only if each day is independent of the last, which is rarely true for a bot that adds to losing trades.
A worked example: $10,000 and a 1 percent daily swing
This is a made-up account of $10,000 whose daily returns have a standard deviation of 1 percent, with an average near zero. Under the normal-curve method the one-day VaR at each confidence level is the z value times 1 percent times $10,000.
| Confidence | z value | One-day VaR | Reading |
|---|---|---|---|
| 90% | 1.2816 | $128.16 | About 10 days in 100 should lose more |
| 95% | 1.6449 | $164.49 | About 5 days in 100 should lose more |
| 99% | 2.3263 | $232.63 | About 1 day in 100 should lose more |
Calculated by us on 29 Oct 2026, exact for these made-up inputs and the standard normal values. At 95 percent, $164.49 is 1.6449 x 1 percent x $10,000. Moving from 95 to 99 percent lifts the figure from $164.49 to $232.63, so VaR depends heavily on the confidence level chosen, and a report that does not state it is not meaningful.
A worked example: the bot that wins small and loses big
Now a made-up 100-day record for a bot of the martingale or grid kind: 96 days of +0.25 percent, 3 days of -0.5 percent, and one day of -10 percent when a ladder failed. Total over the record: +12.50 percent by simple addition. Sort the days from worst to best. The 95 percent historical VaR is the loss on the fifth worst day of the 100.
| Measure (100 days, percent of the account) | Value | What it says |
|---|---|---|
| Fifth worst day: historical VaR, 95% | No loss | The fifth worst day was a small gain, so the number says "no loss" |
| Normal-curve VaR, 95% | 1.57% | From the mean and the standard deviation of the record |
| Normal-curve VaR, 99% | 2.27% | Still far short of what happened on one day |
| Average of the worst 5 days (expected shortfall) | 2.25% | Looks inside the tail instead of stopping at its edge |
| Worst day | 10.00% | The day that mattered |
Calculated by us on 29 Oct 2026, exact arithmetic on made-up inputs. The record has a mean of 0.13 percent and a standard deviation of 1.03 percent. The tail beyond the 95 percent line holds the whole story: one day of 10.00 percent and three of 0.50 percent. The historical VaR reads off the fifth worst day, which sits right after them, so it reports nothing. Even the 99 percent normal-curve figure, 2.27 percent, is only a part of the 10.00 percent the account actually lost in a single day. On $10,000 that day cost $1,000.
How it hits bots
- Martingale and grid bots collect many small gains and rare, large losses. Their daily returns are lopsided, not bell-shaped. VaR measured over a quiet stretch will be small, and so will the confidence it inspires. See martingale and drawdown.
- Leverage. A loss bigger than the account can hold ends in a stop out or worse, which no VaR figure captures. See stop out.
- Short records. A bot with 100 days of history may not yet have met its bad day. Historical VaR can only see the days that happened.
- Gaps and thin markets. VaR assumes positions can be closed at about the quoted price. In a fast market the exit is worse. See slippage.
- Clustering. Bad days cluster. Three bad days in a row are far more likely than the independence assumption in the square-root rule says.
How to use it without being fooled
- State the horizon, the confidence level and the method every time. A VaR without those is not a number.
- Always put the tail next to it: expected shortfall, which averages the losses beyond the VaR line, and the worst day in the record.
- Check how many bad days the record contains. If it has none, the VaR is about a record, not about the strategy.
- Stress the bot with a loss it has not had: a 5 or 10 percent move against a full ladder, and see what is left. The risk of ruin calculator is one way to start.
What it does not tell you
VaR does not say what the worst case is, how long a drawdown will last, whether the strategy has an edge, or what happens when the market stops behaving like the sample. A low VaR is a statement about the common days. Bots tend to fail on the uncommon ones.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is value at risk?
A single number: the loss a portfolio is not expected to exceed over a set period at a set confidence level. For example, a one-day 95 percent VaR of $164 means the loss should be $164 or less on about 95 days in 100.
How is VaR calculated?
Three common ways: parametric (a normal curve and the standard deviation), historical (sorting past returns and reading the percentile) and Monte Carlo (simulating paths from a model). Each gives a different answer for the same account.
Does VaR show the maximum loss?
No. It marks the edge of the normal range and says nothing about how large the losses beyond it can be. Expected shortfall and the worst day in the record show more of the tail.
Why does VaR understate the risk of a martingale or grid bot?
Their returns are many small gains and rare large losses. A VaR taken at 95 or 99 percent over a quiet record can sit below the small losses and miss the rare one entirely.
What confidence level should be used?
There is no single correct one. Banks often quote 95 and 99 percent. The figure rises steeply with the level, so always state which one a number uses.
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 explains a risk measure in general terms. The accounts and records in the examples are made up.
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