Risk Calculator for MT4 and MT5: How to Calculate Lot Size from Your Stop Loss

Risk Calculator for MT4 and MT5: How to Calculate Lot Size from Your Stop Loss

5 December 2026, 09:13
Vladimir Pastushak
0
9

Suppose you have $1,000 in your account and want to risk 1% on a trade. The dollar amount is easy enough: $10. But what number should you enter in the Volume field in MetaTrader? How many lots can you trade with a stop below the most recent low? What if the next suitable stop is twice as far away?

I wrote VR DropRiskTrade, a free script for MetaTrader 4 and MetaTrader 5, to answer that question directly on the chart. Drag the script to your intended stop-loss price, enter a risk percentage, and it shows the lot size and estimated loss in your account currency. If you decide to take the trade, you can submit a market order with the stop loss from the same dialog.

Watch the video walkthrough for MT4 and MT5

Download the VR DropRiskTrade risk calculator for MetaTrader 4 and MetaTrader 5

How to install the risk calculator in MetaTrader

  1. Download VR DropRiskTrade.zip from the download page and extract the archive.
  2. Open the terminal where you want to use the calculator. Choose File → Open Data Folder.
  3. For MetaTrader 4, copy the .ex4 script file to MQL4/Scripts . For MetaTrader 5, copy the .ex5 file to MQL5/Scripts .
  4. Return to the terminal. In the Navigator, right-click Scripts and select Refresh. You should now see VR DropRiskTrade in the list.

If you have several terminals installed, each can have its own data folder. I open the folder from inside the terminal where I expect to find the script. In the video, installation starts at 1:38 and the MetaTrader 4 demonstration starts at 7:42.

Where to drop the script on the chart

Open the chart of the instrument you plan to trade. Suppose I want to buy EURUSD and have identified the price below which I would abandon the trade. I drag VR DropRiskTrade from the Navigator and release the mouse at that price in the main chart window. The script reads the price at the drop point and uses it to set the proposed stop loss.

  • For a BUY, drop the script below the current Bid. The calculation uses the current Ask as the entry price.
  • For a SELL, drop it above the current Ask. The calculation uses the current Bid as the entry price.

The drop point also determines the trade direction. For example, if I plan to sell with a protective stop above a recent high, I release the mouse at that level. The calculator then displays SELL. If I drop it inside the spread or exactly on Bid or Ask, the script asks me to choose another level.

The script aligns the stop with the instrument's tick size. It rounds a buy stop loss down and a sell stop loss up, then checks the broker's minimum stop distance. You can read the exact stop price in the calculation before deciding whether to trade.

How the script calculates lot size

The input that controls risk is RiskPercent. Its default value is 1.0, meaning one percent. The script applies it to current account equity. This matters when you already have open positions. For example, with a balance of $1,000 and equity of $950, a 1% limit gives the script a risk budget of $9.50.

Cash risk limit = account equity × risk percentage / 100.

The script first estimates how much a move from entry to stop would cost at the symbol's minimum lot size. In MetaTrader 5, it uses OrderCalcProfit . In MetaTrader 4, it counts the ticks between entry and stop and uses the tick value reported by the terminal. The result is expressed in your account currency.

Here is a calculation you can check by hand. Assume $1,000 in equity, 1% risk, and a planned EURUSD buy at 1.08400 with a stop at 1.08200. That is a distance of 20 pips, or 200 terminal points on a five-digit quote. For this example, assume a standard EURUSD contract on a USD account, where one pip is worth $10 per standard lot.

  1. The cash risk limit is $10.
  2. At a minimum volume of 0.01 lots, a pip is worth $0.10. A 20-pip move would therefore cost $2.
  3. Five minimum-sized positions fit that budget. The corresponding trade size is $10 / $2 × 0.01 = 0.05 lots.

Now move the proposed stop closer, to 1.08300. The distance falls to 10 pips. The same $10 risk limit now allows 0.10 lots. To compare two levels on the chart, I click Cancel after the first calculation, drop the script at the second price, and read the new volume. I cover more worked examples in How to Calculate Lot Size in MetaTrader 5 Using Stop Loss and Trade Risk.

Why the calculator sometimes shows zero lots

Every symbol has a minimum trade size and a volume step. Suppose the calculation gives 0.025 lots and the broker accepts volume in steps of 0.01. The script rounds down to 0.02 lots and checks the estimated loss again. Rounding up to 0.03 would take the trade over its risk budget.

Sometimes even the smallest trade is too large for the chosen stop. For example, you might have a budget of $5 when the estimated loss at the minimum lot is $8. The script will display zero lots, show the estimated loss at the minimum volume, and end the calculation. The two cash amounts tell you exactly why the trade does not fit.

How to check the result or open a trade

Click OK in the input settings to open the trade confirmation dialog. It shows the symbol, direction, entry price, stop price, distance in terminal points, cash risk limit, lot size, and estimated loss at the stop.

In the video, I show a EURUSD sell with a stop distance of 406 points. The calculator displays 2.45 lots and an estimated loss of $994.70. On a five-digit EURUSD quote, 406 points is 40.6 pips. Using $10 per pip for one standard lot, you can check the result directly: 40.6 × $10 × 2.45 = $994.70.

  • Just checking the lot size? Click Cancel. It is the default selection. The script exits without sending an order.
  • Ready to trade? Check the direction, volume, and stop price, then click OK in the confirmation dialog. To send the order, automated trading must be enabled for the terminal and the script, and permitted on the account.

The quote can move while you read the figures. After you confirm, the script reads the quote and account equity again. If the previous lot size would now exceed the risk limit, you see a fresh calculation and can review it before confirming again. If the stop is now too close to the market, the script displays a message and exits.

After submitting an order, read the execution message from the terminal. The loss figure in the calculator assumes entry and exit at the prices shown. Actual fills and trading costs affect the final result. I explain these costs in Spread, Slippage and Commissions: The Hidden Cost of a Trade.


Recommendations

For a first run, I suggest opening a demo account and trying two drop points. Drop the script below the market and read the BUY calculation. Click Cancel, then drop it above the market and read the SELL calculation. In two runs, you can see how the mouse position sets the stop, direction, and distance used to calculate volume.

The script exits once its task is complete. If you later move the stop farther away on an open position, the volume stays the same and the potential loss increases. That is why I choose my stop level before calculating the lot size. If you use volatility to help choose that level, you may also find my guide to ATR and VR ATR Pro useful.

If you try the calculator, let me know in the comments which instrument you used, where you placed the stop, and what lot size you got. I share new MetaTrader scripts and videos on the Trading-Go Telegram channel.

Tags: MetaTrader 4, MetaTrader 5, MQL4, MQL5, VR DropRiskTrade, risk calculator, lot size calculator, stop loss, trade risk, position sizes, risk management

I'm Vladimir, a trader and MetaTrader developer. You can find more of my articles and trading tools on my MQL5 profile. Feel free to add me as a friend.