Smart Risk and Lot Size Panel
- Yardımcı programlar
- Sürüm: 1.0
Drag the stop loss line to your level and the panel works out the lot size for the risk you set, from your broker's own contract size.
FEATURES
- Entry, stop loss and take profit lines you drag.
- Lot size normalised to the broker's minimum, maximum and step.
- Risk as a percentage of balance or equity, fixed cash, or fixed lot.
- Live risk to reward ratio.
HOW TO USE IT
1. Attach it to a chart and drag the three lines.
2. Set the risk basis and value in the inputs.
3. Read the lot size from the panel.
PARAMETERS
InpRiskMode, InpDefaultRisk, InpDefaultSLPips, InpDefaultRRFactor, InpPanelX, InpPanelY, and the colours.
LIMITATIONS
- The risk value is set in the inputs, not on the chart.
- The lot comes from the symbol's current tick value, so a specification change moves it.
- The pip counters assume a five or three digit quote.
COMPATIBILITY
Any symbol on your account. It calculates only. Native MQL5, no DLLs.
SUPPORT
Questions through the MQL5 message system. First reply within two working days.
HOW THE LOT IS CALCULATED
The stop distance is measured in points between the entry line and the stop loss line. The money at risk for one lot is derived from the symbol's tick size and tick value, so the result follows your broker's own contract specification rather than an assumption. The lot is then rounded down to the broker's volume step and clamped to the broker's minimum and maximum volume. In the three money-based modes, if the resulting lot would use more than 70 per cent of free margin, it is reduced. In fixed lot mode the lot is used as given and that margin cap does not apply.
PARAMETERS IN DETAIL
- InpRiskMode: the calculation basis. A percentage of account balance, a percentage of account equity, a fixed cash amount, or a fixed lot size.
- InpDefaultRisk: the risk value. A percentage in the percentage modes, an amount in the fixed cash mode and a lot size in the fixed lot mode.
- InpDefaultSLPips: the stop distance in pips used when the lines are first drawn. Default 25.
- InpDefaultRRFactor: the take profit multiple used when the lines are first drawn. Default 2.
- InpPanelX, InpPanelY: the panel position in pixels.
- InpPanelBgColor, InpPanelTextColor, InpAccentColor: the panel colours.
NOTES
- The entry line is drawn at the ask price when the tool is attached, with the stop loss and the take profit lines placed at the default pip distance and reward factor from it. All three are yours to drag after that.
- The panel recalculates on every tick, at most once a second, and immediately after a drag, so the lot follows the current balance or equity.
- The pip counters assume a standard five or three digit quote. On a symbol quoted with a different number of digits, the pip figures shown are not the conventional pip.
- The panel shows the risk value in the unit your mode uses: a percentage in the two percentage modes, an amount in the fixed cash mode and a lot size in the fixed lot mode.
- The tool calculates a lot size. It places, modifies and closes nothing.
If you have used it, I would welcome a short review of what worked and what did not.
