Position Size Panel
- Utilities
-
Ciprian Ghebanoaei
Algorithmic trader and MQL5 developer from Romania, building Expert Advisors since 2018. - Version: 1.0
Position Size Panel calculates the lot size from the risk you choose and the distance to your stop loss, and shows it on the chart together with draggable SL and TP lines. Optional BUY and SELL buttons send the order with that lot, stop loss and take profit — only when you click.
How it works
- Enter the risk as % of equity, % of balance or a fixed amount.
- Enter the stop-loss distance (pips on forex, points on gold, indices and other CFDs) and the reward-to-risk ratio — or simply drag the SL line on the chart. Drag it below the price for a long trade, above for a short trade; the TP line follows the R:R.
- The panel shows the lot size (rounded down to the broker's lot step), the real money at risk after rounding and its % of equity, the value of one pip/point per lot and the TP distance.
- If even the broker's minimum lot would risk more than you set, the panel says so in red and the buttons stay disabled.
Order buttons (optional)
Before sending, the panel checks the minimum lot, the broker's stops level, free margin and whether trading is allowed. The order is sent at market with the calculated SL and TP; the result is shown on the panel.
Works with any symbol
Forex, gold, indices, crypto CFDs — the loss per lot comes from the broker's own contract data (OrderCalcProfit), not from a fixed pip value.
Inputs
- Risk mode (% equity, % balance, money) and value (1.0).
- Default SL: 20 pips on forex, 500 points on other symbols. Default R:R 2.0 (0 = no TP).
- Show lines, line colours.
- Show BUY/SELL buttons, magic number, comment, max slippage.
- Panel corner, X/Y offset, font size.
Notes
- It never trades on its own. In the Strategy Tester it only displays the panel.
- Attach it to the chart of the symbol you want to trade, one panel per chart.
Free tool by the same author: Session Range DST (session boxes with correct broker time). Account protection: Prop Firm Drawdown Guard.
