Risk and Lot Size Calculator Lines
- Utilities
-
Kazuma Uezono
MQL5 / MQL4 / Pine Script v6 developer and active trader.
Seller on the MQL5 Market (indicators for MT4/MT5).
Services:
- TradingView Pine Script to MT5/MT4 conversion (bar-by-bar matching, with tester report)
- MT4 to MT5 migration - Version: 1.0
- Activations: 5
Risk and Lot Size Calculator for MetaTrader 4 works out the lot size for the amount you are prepared to lose. Drag three lines on the chart (entry, stop loss, take profit) and the panel shows the lot size, the money at risk, the profit at the take profit, the risk:reward ratio and the margin required, with an optional view of the loss room left on a prop (funded) account.
It is meant for manual traders who want to size each position from the stop distance before they place the order. It is a calculation and display tool only: it never opens, modifies or closes any order. The numbers are an estimate; the real fill, profit/loss and margin are decided by your broker's conditions.
Features
- Three horizontal lines: entry (dashed), stop loss and take profit. Move the mouse onto a line and drag it. A stop loss below the entry means a buy, above the entry means a sell. The entry line can also follow the current price ("Follow price" button).
- Panel: lot size (large) and direction, money at risk and its % of the base, the target amount, stop distance (pips on forex, price difference and points on other symbols) with and without the spread, take-profit distance, risk:reward, profit at the take profit, margin required, spread, loss per 1 lot.
- Warnings: the minimum lot already exceeds your risk (the actual risk is then larger than the target), limited to the maximum lot, not enough free margin, stop closer than the stops level, new trades or this direction not allowed on the symbol, take profit on the wrong side.
- Optional prop-account view: daily room and max room left, and both "after a stop-out" at the current lot size, with a warning when that stop-out would reach a limit.
- Text on each line (lot size, distances, money at risk, profit, risk:reward). Buttons: Copy lot, Reset lines, Follow price; click the title bar to collapse the panel.
- English or Japanese, chosen automatically from the terminal language (can be set by hand). Colors follow the chart background (or set light/dark). Any corner, three sizes.
Main Inputs
- Risk: risk based on % of balance, % of equity, a fixed amount in account currency, or % of the prop-account room left (the smaller of the daily and the max room); risk %; fixed amount; add the current spread to the stop distance (on by default); round-turn commission per 1 lot (0 by default).
- Lines: entry price (line or current price), side of the first placement, ATR period and stop / take-profit distance for the first placement, take-profit line on or off, text on the lines, line colors.
- Prop account (off by default): initial balance (0 = automatic), challenge start, daily and max loss limits in % or as an amount, daily % based on the initial balance or the day-start balance, known max-loss equity level (for trailing rules), today's P/L automatic or by hand, daily reset time and time zone (server time, UTC, Central Europe CET/CEST or New York EST/EDT, summer time automatic).
- Panel: language, corner, offsets, size, colors, start collapsed. The input groups are marked with "===" separator lines.
How It Is Calculated
- Lot size = risk amount / loss per 1 lot over the stop distance (plus spread and commission when set), rounded DOWN to the symbol's volume step and kept within the minimum and maximum volume.
- Symbols quoted against your account currency use the stop-loss / take-profit price for the conversion (for example USDJPY on a USD account). Cross symbols use the current rate of a conversion symbol (via USD if needed).
- On some CFD symbols (gold, silver, indices, crypto, oil) the "tick value" returned by the terminal may not be converted to the account currency. The indicator checks it against price distance x contract size x conversion rate and uses the latter when they differ by more than 5%.
- Line prices are chart (Bid) prices. A buy is filled at Ask, so the spread is added once to the stop distance as a simple, conservative approximation (for both buy and sell).
- The margin is the terminal's margin per 1 lot for the symbol (at the current price) x lot size. Broker-specific rules (for example hedged positions) are not included. When the terminal returns no value, "-" is shown.
- Prop room: today's P/L automatic = equity minus the balance at day start, counted from the closed orders in the Account History tab, so set that tab to "All History". For trailing max-loss rules, enter the current max-loss equity level by hand (the indicator does not track the trailing peak).
- The calculation is the same as in the MetaTrader 5 version. Before release the lot sizes were checked against a hand calculation on demo accounts and in the Strategy Tester. These are results for the accounts, symbols and time of the check; other brokers and symbols can differ.
Notes and Limits
- The spread at the time of the order, slippage and gaps can make the real loss larger than shown. Swap is not included.
- Presets and firm names are not included. Check the current rules of your own program and set the inputs to match.
- One copy per chart. While the mouse is on a line, chart scrolling is paused so that the line can be dragged.
- Copy lot does not use the clipboard (not available to MQL4 programs). It saves the lot size to the global variables RLC_Lot and RLC_Lot_<symbol> (press F3 to see them).
- The lines stay on the chart when the terminal is closed and are back at the same prices after a restart. Removing the indicator removes the lines.
- Do not set the daily reset to a time that occurs twice when summer time ends (02:00-02:59 Central Europe).
- This is a calculation tool, not a trading signal or advice. It does not guarantee any result or that a loss stays within any amount or rule. Before you place an order, check the volume and the expected loss in your platform's order window. Trade decisions and their results are your own responsibility.
Compatibility and Support
- MetaTrader 4 only. The MT5 version is a separate product. Any symbol and timeframe.
- No DLLs, no internet access, no files (except an optional debug CSV).
- A PDF user guide (English or Japanese) is sent on request through MQL5 messages after purchase.
- Support through MQL5 messages, reply within 3 business days, for installation, settings and bug reports. Questions about how much to risk, how a particular program's rules should be read, market views or trade decisions cannot be answered.
