Back to Blog
Trading Education

Monte Carlo for Trading: VaR, CVaR, and Probability of Profit

QFQuantForge Team·April 3, 2026·8 min read

A backtest gives you one number for every metric: one Sharpe ratio, one maximum drawdown, one total return. These are point estimates from one specific sequence of trades. They tell you what happened. They do not tell you the range of what could have happened.

Monte Carlo simulation produces distributions instead of point estimates. By reshuffling the same trades 1,000 times, it shows you the range of possible outcomes: the best case, the worst case, the median, and the probability of profit. These distributions are far more useful for risk management than any single backtest number.

Value at Risk (VaR)

Value at Risk answers the question: what is the worst loss I should expect with a given confidence level? The 95 percent VaR (or equivalently, the 5th percentile return from Monte Carlo) tells you that 95 percent of possible trade sequences produce better outcomes than this number.

If your strategy's 5th percentile return from 1,000 Monte Carlo simulations is negative 8 percent, your VaR at the 95 percent confidence level is 8 percent. You should expect to lose at most 8 percent in 95 out of 100 possible realities. In the other 5 realities, losses exceed this threshold.

We calculate VaR from the sorted return distribution using linear interpolation between neighboring percentile values. For 1,000 simulations, the 5th percentile falls between the 50th and 51st sorted values. Linear interpolation between these two values produces a smoother estimate than simply taking the 50th value.

VaR is the primary metric we use for position sizing. If a strategy's 95 percent VaR exceeds our per-bot drawdown limit of 20 percent, we reduce the capital allocation until the VaR fits within the budget. This ensures that even in a bad (5th percentile) trade sequence, the bot does not breach its circuit breaker.

Conditional Value at Risk (CVaR)

CVaR, also called Expected Shortfall, answers a question that VaR leaves open: if things go worse than VaR, how bad does it get? VaR tells you the boundary of the 5 percent worst outcomes. CVaR tells you the average of those worst outcomes.

If your 5th percentile return is negative 8 percent but the average of all returns below the 5th percentile is negative 14 percent, your CVaR is 14 percent. This means that in the worst 5 percent of scenarios, you lose 14 percent on average. Some of those scenarios are worse than 14 percent; CVaR is the mean of the tail.

CVaR is more conservative than VaR and captures tail risk better. A strategy with VaR of 8 percent and CVaR of 9 percent has a well-behaved left tail: the worst outcomes are only slightly worse than the VaR boundary. A strategy with VaR of 8 percent and CVaR of 25 percent has a fat left tail: when things go wrong, they go very wrong. The second strategy requires more conservative sizing even though both have the same VaR.

We display both VaR and CVaR in our Strategy Risk tab and per-bot Monte Carlo panel. The ratio between them indicates tail risk severity and informs whether our standard risk limits are sufficient or need tightening.

Probability of Profit

The simplest Monte Carlo metric is the probability of profit: the fraction of simulations that ended with a positive return. If 920 out of 1,000 simulations produce a positive final return, the probability of profit is 92 percent.

This metric is intuitive and directly actionable. We require a probability of profit above 85 percent before deploying any strategy. Below 85 percent means more than 1 in 7 possible trade sequences would lose money. That is too much uncertainty for production capital.

The probability of profit also helps compare strategies that have similar Sharpe ratios. Two strategies might both have Sharpe ratios of 3.0, but one might have a 95 percent probability of profit while the other has 82 percent. The second strategy has more variance in outcomes, which means it is more likely to produce a losing sequence despite having the same average risk-adjusted return.

Drawdown Distribution

Beyond return metrics, Monte Carlo produces a distribution of maximum drawdowns across all simulations. The median drawdown tells you the typical worst-case equity decline. The 95th percentile drawdown tells you the severe case that you should plan for.

If a single backtest shows a 12 percent maximum drawdown, you might set your circuit breaker at 15 percent with a comfortable buffer. But the 95th percentile Monte Carlo drawdown might be 22 percent. Setting the breaker at 15 would trigger in a significant minority of possible trade sequences, pausing the bot during conditions that are within the strategy's normal distribution.

We use the 95th percentile drawdown to calibrate per-bot circuit breaker levels. Our default of 20 percent was chosen because it exceeds the 95th percentile Monte Carlo drawdown for our deployed strategies while providing enough room for normal variance.

Bootstrap Resampling

Our Monte Carlo implementation uses bootstrap resampling with replacement. This means each simulation draws trades randomly from the original set, allowing the same trade to appear multiple times or not at all. This is appropriate for trading strategies because it models the uncertainty in trade ordering: you know what types of trades the strategy produces, but you do not know the sequence.

The process for each of the 1,000 simulations: draw N trades randomly with replacement (where N is the original trade count), play them sequentially against the starting capital, track the equity curve, record the maximum drawdown and final return. After all simulations, sort the results and extract percentiles.

One limitation: bootstrap resampling assumes trades are independent. In practice, losing trades may cluster (during adverse regimes) and winning trades may cluster (during favorable regimes). Resampling breaks these clusters, which can underestimate the severity of real drawdowns where losses come in sequences rather than randomly distributed.

How We Use It in Production

Monte Carlo appears in two places in our platform. The Strategy Risk tab allows running Monte Carlo for any strategy-symbol combination with configurable simulation count. This is used during strategy evaluation to assess risk characteristics before deployment.

The per-bot Monte Carlo panel in the bot detail view shows the risk profile for each running bot using its specific strategy, symbol, and parameters. The trade PnL values come from the most recent validation or sweep run matching the bot's configuration. This provides a per-bot risk assessment that is more specific than a generic strategy-level analysis.

Deployment decisions use Monte Carlo as follows: probability of profit must exceed 85 percent, the 95th percentile drawdown must not exceed the per-bot circuit breaker threshold of 20 percent, and if the 5th percentile return is negative, the median return must be at least double the 5th percentile loss magnitude as a safety margin.

These thresholds come from experience running 45 paper bots and comparing Monte Carlo projections to actual outcomes. The projections have been reasonably calibrated so far, with real drawdowns falling within the Monte Carlo confidence intervals consistently.