Many daily loss breaches come from position size, not from the entry idea. The same lot on a 3 dollar stop and on a 15 dollar stop on gold carries very different risk. This script works the size backwards: from the cash you accept to lose on one trade and the distance to your stop.

It reads the tick value and tick size of the current symbol, so the result is correct for gold, currency pairs and indices without manual contract math. The lot is rounded down to the broker volume step, and the script warns when the result is below the broker minimum.
Inputs
Output
Loss per 1.00 lot at this stop, the lot size rounded down, the loss if the stop is hit, and the number of full losses that fit your daily limit. The result is shown on the chart (Comment) and in the Experts log.
How the calculation works
The script reads SYMBOL_TRADE_TICK_VALUE and SYMBOL_TRADE_TICK_SIZE for the chart symbol. From them it computes the money value of one point for 1.00 lot, multiplies it by the stop distance plus the slippage allowance, and gets the loss per 1.00 lot at that stop. Dividing the cash you accept to lose by this figure gives the raw lot size, which is then rounded down to SYMBOL_VOLUME_STEP and checked against SYMBOL_VOLUME_MIN and SYMBOL_VOLUME_MAX.
| loss per 1.00 lot | (stop points + slippage points) x point / tick size x tick value |
| lot size | cash at risk / loss per 1.00 lot, rounded down to the volume step |
| losses that fit the daily limit | daily limit / loss at the rounded lot, rounded down |
Example on gold (XAUUSD)
On a typical gold contract of 100 ounces, one dollar of price movement is worth about 100 units of account currency per 1.00 lot. With a 5 dollar stop (500 points on a two-digit quote), a 50 point slippage allowance and 250 of cash at risk, the loss per 1.00 lot is about 550, so the script suggests 0.45 lots, rounded down from 0.4545. With a daily limit of 1,000, two such full losses fit, and the third would cross it. Contract sizes differ between brokers, which is why the script reads them from the symbol instead of assuming them.
How to use it
Notes
The script uses the current tick value, which can change with the exchange rate when the account currency differs from the profit currency of the symbol. Run it again shortly before you enter. It does not know your open positions or today's closed result; the daily figure it shows is simply how many losses of this size fit inside the limit you typed.
The script is read-only: it opens, modifies or closes nothing. Every number is typed by you. A gap or slippage at your broker can carry a loss past any stop.
Intraday Volatility Profile
Typical range of each time of day (median of the previous N days) versus the actual range of the bar. Shows when the market really moves. No look-ahead, no repainting. M1 to H1.
Rollover Cost Table - swap mode from the symbol, triple-swap day from the broker
An MQL5 indicator that draws a table on the chart with one row per open position and shows what one more night of holding it costs, in the deposit currency where the symbol's swap mode allows it. The swap mode and the two rates come from the symbol's own specification, and so does the triple-swap weekday; no rate is typed into the code. Where the symbol charges in points, a horizon column turns that night into the number of normal nights needed to repay one round turn, and a figure the terminal cannot supply is a dash with a reason, never a zero.
PassRecorder
A library for MetaTrader 5 that writes every pass of an optimization to a SQLite file: result, test statistics, your own metrics and the inputs of the pass. A demo Expert Advisor optimizes the Rosenbrock function in the mode "Math calculations".
MACD Signals
Indicator edition for new platform.