Discover expert developed MetaTrader tools that can complement professional solutions.
Lot size on Gold (XAUUSD), forex, indices or crypto comes from two numbers you type on the chart: the risk, as a percent of balance, a percent of equity or a fixed amount, and the stop loss in points. The loss of 1.00 lot at that stop is taken from OrderCalcProfit, so the figure is right on gold, indices and cross pairs, not only on EURUSD.
The lot is rounded down to the broker volume step and capped by the broker maximum and your own maximum. The BUY and SELL buttons open the trade at market with the stop and the take profit already attached, after a free margin check and a check of the broker minimum stop distance.
Rounding down means the money really at risk can be a little below your number, and the panel shows both. If the risk is too small for the broker minimum lot, it refuses the trade unless you allow the minimum. Try it on a demo account first.
Experience adaptive trading with the Fluid Expert Advisor for MT4/MT5. Dynamic money management and trend detection. Click for info.
Settings
- Risk mode and risk per trade: percent of balance, percent of equity or money. The mode can also be changed with the button on the panel.
- Stop loss and take profit in points. On a gold quote with 2 decimals 300 points is a 3.00 USD move, with 3 decimals it is 0.30 USD. Take profit 0 means no target.
- Use the minimum lot: off by default. On, a lot below the broker minimum is raised to the minimum and the real risk is shown.
- Never send more than: your own lot cap. Default 5.0.
- Refuse a trade that risks more than: percent of balance. Default 5.
- Magic number, max deviation, order comment, panel position and font size.
What it needs
Hedging or netting account, any symbol, any broker. It only opens a trade when you press BUY or SELL. It never closes or modifies positions.
Make it yours
Put it on XAUUSD, EURUSD, GBPUSD, US30, NAS100 or BTCUSD and watch how the loss per lot changes from one symbol to another for the same stop. XP_LossPerLot and the rounding in XP_Recalc are ready to copy into any EA that needs risk based lots, and the panel is plain on purpose so you can add your own buttons, a breakeven or a partial close.
About this code
Open source. Use it as it is, adapt it, build your own version on top of it.
New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander
Questions, suggestions and your own backtests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01
More tools on my profile: https://www.mql5.com/en/users/09151993a
Provided as is, use at your own risk.
Related
- Close All Positions Panel
- Trailing Stop Breakeven Manager
- Partial Close Multi TP Manager
Changelog
- v1.0 - 2026-11-02 - Initial release
Level up your trading with professional RobotFX expert advisors and indicators. Visit robotfx.org for proven MT4/MT5 tools.
79402