HOW THE ENGINE WORKS

Calculation methodology

Risk Lab turns a maximum loss budget into a position size. Every limit is applied before the final rounding step, so the calculation never increases risk artificially.

1. Validate market inputs

The engine first checks finite values, logical bounds and price alignment with the tick size. For a CFD, point value, lot step, contract size and leverage must match the broker's actual specifications.

2. Determine the effective budget

The planned budget is a percentage of equity. It is then compared with the remaining drawdown room, daily loss room and portfolio risk room.

effective budget = min(equity × risk %, remaining drawdown, remaining daily loss, available portfolio risk)

Available portfolio risk uses a variance-correlation combination of open risk and the new trade. Positive correlation reduces capacity further; enter a negative correlation only when it is justified.

3. Calculate the cost of one unit

The theoretical stop is not enough: the calculation adds estimated slippage and, for CFDs, spread. Round-trip commission is then added.

unit cost = (stop distance + slippage + CFD spread) × point value + commission

When account and contract currencies differ, this cost is converted with the entered EUR/USD rate. Risk Lab does not fetch live exchange rates.

4. Size without exceeding limits

raw quantity = effective budget ÷ unit cost

Quantity is always rounded down to the allowed step. The engine then applies the maximum size and, for CFDs, the quantity supported by available margin. A budget too small for one unit produces a zero size.

5. Measure reward and expectancy

Potential reward also subtracts estimated execution costs. Reward-to-risk, break-even win rate and expectancy are calculated on that basis.

expectancy = win probability × reward − loss probability × risk

Positive expectancy based on an assumed win rate does not prove a statistical edge. Test it against a representative sample, real execution conditions and changing market regimes.

Known limitations

  • No market, broker or prop firm data is fetched automatically.
  • Spread, slippage, commission, correlation and exchange rates are user-provided assumptions.
  • The model does not cover gaps, available liquidity, order rejection, overnight financing or taxes.
  • Results predict neither win probability nor the actual maximum loss.