Universal Position Size Calculator
- ユーティリティ
- Tshilidzi Enocent Munyai
- バージョン: 1.0
- アクティベーション: 10
Know Your Exact Lot Size Before Every Trade
Universal Position Size Calculator solves the most common problem in manual trading: "How many lots should I trade?"
Set your dollar risk amount and stop-loss distance. The calculator instantly gives you the precise lot size — on any symbol. Forex, stocks, crypto, metals, indices, futures. It handles them all correctly because it uses MT5's own OrderCalcProfit() function, not simplified pip-value formulas that break on non-Forex instruments.
Why This Calculator Is Different
Most position size tools use simple pip-value math. That works for major Forex pairs, but gives wrong results on stocks, crypto, and futures where tick values, contract sizes, and profit calculations differ. This calculator uses OrderCalcProfit() — the same function MT5 uses internally — so the lot size is accurate regardless of the instrument type.
Features
- Accurate on ALL symbols — Forex, Stocks (AAPL, TSLA), Crypto (BTCUSD), Metals (XAUUSD), Futures. Powered by OrderCalcProfit() with tick-value fallback.
- Draggable on-chart panel — Edit Risk ($), Stop Loss, and Take Profit directly on the chart. No need to re-attach the EA to change parameters.
- One-click BUY / SELL — Execute trades instantly with calculated lot size, SL, and TP.
- Auto order splitting — If your calculated lots exceed the broker's maximum volume per order, the EA automatically splits into multiple orders.
- Min SL protection — Prevents you from placing trades with a stop loss below the broker's minimum distance (STOPS_LEVEL + SPREAD).
- Over-risk warning — When even the minimum lot size risks more than your target, you get a clear orange warning with the actual risk amount.
- Existing position tracking — See how many positions you have open and your total dollar risk at a glance.
- Magic number filtering — Only tracks positions opened by this EA, so other EAs on the same chart don't interfere.
- Real-time updates — Calculations refresh on every tick as prices change.
- Color-coded risk display — Green under 5%, orange 5-10%, red above 10% of balance.
How To Use
- Attach the EA to any chart.
- Set your Risk ($) — the dollar amount you are willing to lose on this trade.
- Set your SL (points) — your stop-loss distance from entry.
- Optionally set TP (points) — your take-profit distance (0 = no TP).
- The panel instantly shows: Lots, Actual Risk, Risk % of Balance, and Order count.
- Click BUY or SELL to execute.
Input Parameters
- Risk amount in USD — Your dollar risk per trade. Set to 0 to use percentage mode.
- Risk as % of balance — Used when Risk USD is 0. Example: 1% of $10,000 = $100 risk.
- SL distance in points — Stop loss distance from entry price.
- TP distance in points — Take profit distance. Set to 0 for no TP.
- Slippage tolerance — Maximum allowed slippage in points.
- Magic number — Unique identifier for this EA's trades.
- Trade comment — Comment attached to each order.
- Buy/Sell button colors — Customize the panel appearance.
- Only track own trades — Filter positions by magic number.
Important Notes
- This is a manual execution tool, not an automated trading bot. It calculates and executes on your command.
- In Strategy Tester, use Visual Mode to interact with the panel.
- The editable spin controls support both arrow clicks (step: Risk +/- $10, SL/TP +/- 100 pts) and direct keyboard input.
- Tested with 0 errors, 0 warnings in MetaEditor build 4700+.
