Many lot size calculators hardcode pip value assumptions that break on gold, indices, JPY crosses, and non-USD account currencies. A sizing routine should use the tick and volume properties the trade server publishes per symbol, then compute risk from those inputs. CalcLots() takes risk in account currency plus entry and stop prices, then returns the trade volume and the actual risk after broker constraints. Volume is always rounded down to the volume step. If requested risk is below the minimum lot, the minimum is returned, clamped_min is set, and the higher real risk is reported. The function is direction-agnostic and also provides stop distance in points and point value per 1.00 lot. The sizing math is isolated in Calc.mqh with no terminal state. It consumes a SymbolSpec struct and can be tested offline. SpecFromSymbol() is the only live-data bridge and... 👉 Read | NeuroBook | @mql5dev
Open in Telegram
Many lot size calculators hardcode pip value assumptions that break on gold, indices…
Views13,306+32%vs avg
Forwards7
Reactions5
Comments—
Views growth
Hours after publication
Show as table
| Hours after publication | Views |
|---|---|
| 0 h | 0 |
| 1 h | 1,121 |
| 15 h | 8,107 |
| 33 h | 13,306 |
- After 1 hour1,121
- Total to date13,306
More from MQL5 Algo Trading
- 01Views16.6KForwards9Reactions—Comments—
- 02Views12.5KForwards5Reactions34Comments—
- 03Views12KForwards6Reactions40Comments—
- 04Views11.9KForwards4Reactions16Comments—
- 05Views11.5KForwards4Reactions27Comments—