MT4 Lot Size Calculation: Inputs, Units, and Limits
A risk-based lot calculation estimates volume from a chosen monetary risk budget and the loss per lot at a planned stop. It does not guarantee a maximum realized loss: gaps, slippage, costs, and contract or currency assumptions can change the outcome. This page explains the calculation rather than running a live account calculator.
How Pineify Helps
Pineify can help draft MQL4 lot-sizing logic from a specification. Define units, account currency, budget basis, cost assumptions, volume limits, and failure behavior. Compile and validate the result in MT4; Pineify’s TradingView optimizer and CSV workflow do not backtest this MT4 sizing function.
Use a consistent formula
Estimated lots = monetary risk budget ÷ (stop distance in pips × pip value per lot in account currency). For an arithmetic example, a $100 budget, 20-pip distance, and assumed $10 per pip per lot give 0.50 lots before costs. These are illustrative inputs, not an account recommendation or a tested trade. Zero or negative distance and missing conversion rates must stop the calculation.
Distinguish pips, points, and ticks
A pip convention is not the same as the broker tick size or displayed Point. Read the symbol contract and account currency. MQL4 exposes tick value in deposit currency, tick size, contract size, and minimum/maximum/step volume properties. Confirm the units of the API used: MarketInfo MODE_TICKSIZE is expressed in points, while SYMBOL_TRADE_TICK_SIZE is a price increment.
Convert the loss into account currency
Under the conventional 100,000-unit contract and 0.0001 pip definition, EURUSD and GBPUSD each have a $10 pip value per standard lot when the account is USD. GBPUSD is not inherently higher because its base currency differs. For USDJPY and non-USD accounts, a currency conversion is required; do not substitute a timeless $9.30 value or an unspecified current rate.
Round within the risk budget
Apply broker minimum, maximum, and lot step after estimating size. Round down rather than up when preserving the chosen budget; if the result falls below the minimum, skip the request rather than silently increasing exposure. Recalculate the estimated loss after rounding and add an explicit cost allowance. Check available margin and total existing exposure separately.
Implement and test the MQL4 checks
Specify whether the budget uses balance or equity, how open risk is included, and what happens when market properties or conversions are unavailable. Review the source and test representative symbols, currencies, invalid inputs, minimum size, and unusual lot steps in MT4. An automated calculation can repeat a unit error quickly; code generation does not remove that need for validation.
This page is for informational purposes only and does not constitute investment advice. Trading forex and CFDs carries substantial risk of loss. Past performance does not guarantee future results. Always consult a qualified financial advisor before making trading decisions.