MT4 Indicator Central
Account & Trade Tools non-repaint Free · MIT

MT4 Lot Size Calculator

Category
Account & Trade Tools
Platform
MetaTrader 4
Repaints?
No, updates on closed bars
Licence
MIT
Inputs
3
Price
Free
MetaTrader 4 chart with the Lot Size Calculator panel in the upper-left corner showing account balance, risk percent, stop loss in pips, and a green recommended lot size with the dollar amount at risk.
Lot Size Calculator in MetaTrader 4. Open-source (MIT), by Viprasol Tech.
// at a glance

The MT4 Lot Size Calculator is a free on-chart panel that converts your risk percent and stop-loss distance in pips into an exact, broker-normalized lot size, plus the dollar amount at risk. It is for discretionary forex traders who want consistent position sizing without reaching for a spreadsheet.

If you size every trade by gut feel, your risk per trade is all over the map. The MT4 Lot Size Calculator fixes that by reading your account, applying a fixed risk percent and stop distance, and printing the lot size you should use directly on the chart. It does not place trades or predict price. It does one job: turn your risk rule into a number.

What is Lot Size Calculator, and what does it do in MT4?

The Lot Size Calculator is a free, MIT-licensed custom indicator for MetaTrader 4 by Viprasol Tech. Despite the indicator file type, it draws nothing on the price series. It is a small text panel in a chart corner that shows your balance (or equity), your chosen risk percent and the cash that represents, your stop-loss distance, and the recommended lot size for the symbol on that chart.

Think of it as a position-sizing reference that lives on the chart instead of in a calculator app. You read the lot size, then enter that size in the MT4 order ticket yourself. It is most useful for discretionary traders who want every trade to risk the same fixed slice of the account.

On each tick the indicator reads either AccountBalance() or AccountEquity() depending on the UseEquity setting, then computes the cash at risk as balance times RiskPercent. To convert that into lots it needs the value of one pip for the current symbol, which it derives from MarketInfo tick value, tick size, and point, with a built-in adjustment that detects 5-digit (and 3-digit JPY) brokers so a pip is counted as ten points.

The raw lot size is simply the cash at risk divided by (stop-loss pips times pip value). It then snaps that figure down to your broker's lot step and clamps it between the broker's minimum and maximum lot. The result is printed as the green "Lot Size" line. The number turns orange when the calculation is pinned to the broker minimum and red when it hits the maximum, which is your signal that the risk rule and stop distance no longer fit the account on this symbol.

Because everything is computed live from MarketInfo and account functions, the panel updates by itself as your balance changes or as you switch symbols. It reads the chart's current symbol only and never repaints historical bars, because it does not touch them.

Which Lot Size Calculator inputs matter most?

All inputs are set in the indicator's properties dialog when you drag it on or by pressing the properties button later. The two that matter for the math are RiskPercent and StopLossPips; the rest control the panel's appearance and placement.

InputDefaultWhat it controls
RiskPercent1.0Percent of account balance (or equity) to risk on the trade. This drives the cash-at-risk figure and the resulting lot size.
StopLossPips20.0Your planned stop-loss distance in pips. Larger stops produce smaller lots for the same risk. Must match the stop you actually use.
UseEquityfalseWhen true, sizes off live equity instead of balance, so open floating P/L affects the number. Leave false to size off settled balance.
TextColorclrWhiteColor of the balance, risk, and stop-loss lines. The lot-size and risk-dollar lines use their own fixed accent colors.
FontSize12Base font size for the panel. The title and lot-size lines are drawn one to two points larger.
CornerCORNER_LEFT_UPPERWhich chart corner the panel anchors to (e.g. left-upper, right-lower).
CornerX10Horizontal pixel offset from the chosen corner, for nudging the panel away from the price scale or other tools.
CornerY20Vertical pixel offset from the chosen corner, useful when other indicators already occupy the top of the chart.

How do you add Lot Size Calculator to MetaTrader 4?

  1. Download and unzip the package, then locate the indicator file from the zip (the .mq4 file).
  2. In MetaTrader 4 click File, then Open Data Folder.
  3. Open the MQL4 folder, then the Indicators folder.
  4. Copy the .mq4 file from the zip into that Indicators folder.
  5. Back in MT4, right-click Indicators in the Navigator panel and choose Refresh (or restart MT4).
  6. Drag the Lot Size Calculator from the Navigator onto any chart and set RiskPercent and StopLossPips in the dialog.
  7. Read the lot size from the panel and enter that size in your order ticket when you place the trade.

Where does Lot Size Calculator help, and where does it fall short?

What Lot Size Calculator does well, and where it falls short, with nothing hidden.

  • Removes guesswork from position sizing by turning a fixed risk rule into one exact, broker-normalized lot number
  • Reads tick value, lot step, and min/max lot live from the broker, so the size respects your account's real constraints
  • Auto-adjusts for 5-digit and 3-digit JPY brokers, so the pip math is correct on most modern forex feeds
  • Color cue (orange at min lot, red at max lot) warns when your risk and stop no longer fit the account
  • Lightweight panel that updates itself, never repaints the price series, and cleans up its objects on removal
  • Free and MIT-licensed, so you can read the source and confirm exactly how the lot size is derived
  • It is a calculator, not an order tool. It does not place, modify, or close trades. You still type the lot size into the order ticket yourself
  • Sizes only the chart's current symbol; you have to read it per chart, and switching symbols changes the number
  • Stop distance is a manual input in pips, so the figure is only as good as the stop you actually enter on the trade
  • Pip-value logic is tuned for forex. On indices, metals, or CFDs the pip detection may not match how your broker quotes the instrument, so verify the number before trusting it
  • Floors the raw lot down to the broker step, so on very small accounts or wide stops it can pin to the minimum lot and overstate or understate intended risk
  • No alerts, no logging, and the panel position is fixed once set; it is a deliberately bare-bones utility
// free download

Download Lot Size Calculator free

Enter your email and we will send you Lot Size Calculator for MetaTrader 4, packaged with its original MIT licence and a credit to Viprasol Tech. Come back for any of the other free tools whenever you want one.

We never share or sell your email. One-click unsubscribe in every message.

Lot Size Calculator: questions traders ask

Does it place trades for me?

No. It only displays a recommended lot size and the dollar amount at risk. You enter that lot size manually in the MT4 order window. It cannot open, modify, or close positions.

Does it repaint?

No. It does not draw on the price series or reference historical bars, so there is nothing to repaint. The panel simply recomputes the current lot size live from your account and the broker's symbol data.

Will it work on MT5?

No. This is an MT4 (.mq4) indicator and uses MT4-specific functions like AccountBalance and MarketInfo. It will not compile or run in MetaTrader 5 without being rewritten.

Is it really free?

Yes. It is released under the MIT license, copyright 2026 Viprasol Tech. You can use it, read the source, and modify it for your own setup.

Why does the lot size show in orange or red?

Orange means the result was clamped to your broker's minimum lot, and red means it hit the maximum lot. Both are signals that your risk percent and stop distance no longer fit the account on that symbol, so review your inputs.

Does it work on gold, indices, or other CFDs?

It can run on any symbol, but its pip-value detection is built around forex quoting conventions. On metals, indices, and CFDs, confirm the displayed lot size against a manual calculation before relying on it.


More free MT4 tools