POSITION SIZE CALCULATOR

Position Size Calculator
v1.1.0 • Released Oct 2026

The Position Size Calculator is a Windows desktop app that tells you exactly how many lots to trade. Enter your risk percentage and stop loss, and it works out the correct lot size from your live account data and your broker's real symbol specifications. It is built from two parts: a Windows desktop app and a small Expert Advisor for MetaTrader 4 or MetaTrader 5 that passes your balance, equity, margin and symbol data to the app every second. No more guessing pip values or doing the maths by hand.

The app is a calculator only — it performs no trading operations: it never opens, modifies or closes a single trade.

Key Features:

  • Live Account Sync: balance, equity, free margin, leverage, account currency, Demo/Live and broker server read straight from your terminal.
  • Accurate Pip Value: calculated from your broker's own tick data in your account currency — works for forex pairs, JPY pairs, metals, indices and crypto.
  • Flexible Risk Basis: risk a percentage of your Balance, your Equity or a custom amount, with one-click presets for 0.5%, 1%, 2% and 3%.
  • Stop Loss and Take Profit in Pips, Points or Price — use whichever way you read your charts.
  • Broker-Ready Lot Sizes: rounded down to your broker's lot step so you never risk more than planned, and capped at the broker's maximum lot.
  • Full Trade Breakdown: recommended lot size, target risk, actual risk after rounding, pip value, potential reward, margin required, spread and position size in units, plus a Risk : Reward bar.
  • Smart Warnings: tells you when the minimum lot would risk more than your target, when the required margin exceeds your free margin, when the spread eats a large part of your stop loss, or when your risk is above 5%.
  • Multiple Symbols: calculate for any symbol you list in the EA, or let the app follow the symbol on your chart.
  • Manual Mode: no MetaTrader open? Enter the pip value and lot limits yourself and keep calculating.
  • Copy lot size in one click, keep-on-top pin for use beside your charts, and settings that are remembered between sessions.
  • Connection Status: clear indicator showing when the EA is connected, and when it goes offline.
  • Private by design: runs entirely on your PC, with no accounts, no subscriptions and no telemetry.

What You Get:

  • The Position Size Calculator Windows desktop app (installer, Windows 10/11 64-bit).
  • PositionSizeCalculator.ex4 (MetaTrader 4) and PositionSizeCalculator.ex5 (MetaTrader 5) — the compiled Expert Advisors, ready to attach to a chart. No installation, no external libraries, no DLL imports.
  • Everything runs on your own machine: no cloud accounts, and no data leaves your PC.

Requirements:

  • Windows 10 or 11, 64-bit.
  • MetaTrader 4 or MetaTrader 5 on the same PC (optional — Manual Mode works without it).
  • Algo Trading enabled in MetaTrader so the EA is allowed to run.

How to Install:

  1. Download and install the Position Size Calculator app, then start it — the top bar shows Waiting for EA.
  2. In MetaTrader open File → Open Data Folder, go to MQL4\Experts\ (MT4) or MQL5\Experts\ (MT5) and copy PositionSizeCalculator.ex4 (MT4) or PositionSizeCalculator.ex5 (MT5) into it. No compilation is needed — the EA is supplied ready to run. Then right-click Expert Advisors in the Navigator and choose Refresh (or restart the terminal).
  3. MT5 only: go to Tools → Options → Expert Advisors, tick "Allow WebRequest for listed URL" and add http://127.0.0.1:8080. Click OK. MT4 needs no setting.
  4. Drag PositionSizeCalculator from the Navigator onto any chart (any symbol, any timeframe — it does not trade) and make sure Algo Trading is on.
  5. Within a second the app shows EA connected and fills in your account details. Enter your risk % and stop loss to get your lot size.

EA Input Parameters:

  1. UpdateIntervalSeconds — How often the EA sends your data to the app, default 1 second (MT4 and MT5).
  2. ExtraSymbols — Extra symbols to calculate for, separated by commas, for example GBPUSD,XAUUSD. They appear in the app's Symbol list (MT4 and MT5).
  3. ServerURL — MT5 only. Where the EA sends its data, default http://127.0.0.1:8080/ea/data. Keep it unless you changed the app's port.

Tips:

  • Start the desktop app before attaching the EA so the connection is made immediately.
  • If the app stays on Waiting for EA in MT5, the address is probably not in the WebRequest allow-list (MetaTrader error 4014) — redo step 3, then remove and re-attach the EA.
  • Want a symbol other than your chart's? Add it to ExtraSymbols and pick it from the Symbol list in the app. Make sure it is visible in Market Watch.
  • If the app reports that port 8080 is already in use, close the other program that is using it and restart the app.
  • Use Manual mode to calculate without MetaTrader — enter the pip value per lot and your broker's lot limits.

Note: The Position Size Calculator is a calculation tool. It does not open trades and does not interfere with any trading strategy. Always check the result against your broker's contract specifications before you trade. Trading leveraged products involves substantial risk of loss.

📩 Need Help? Contact us:

Format • Windows app + MT4/MT5 EA (.ex4 / .ex5)