A common way to size a position is risk divided by stop distance times tick value. On forex majors that usually works. On some brokers' metal and index CFDs, or on symbols quoted in a currency other than your account currency, the reported tick value can be stale or set for a different contract, and the lot comes out wrong without any warning.
This utility asks the trade server instead. It calls OrderCalcProfit for one lot from your entry to your stop, so contract size, quote currency and account currency are all handled by the same function the terminal uses for real orders. Then it divides your risk by that loss and rounds down to the symbol's volume step.

XAUUSD H1: 100 USD risk, stop 1678 points away, 0.05 lots, take profit at 2R
How to use it
Attach it to a chart. A red line appears below the price: that is your stop. Drag it. Below the price means a buy (entry at Ask), above means a sell (entry at Bid). The panel updates while you drag and on every tick.
What the panel shows
If even the minimum lot risks more than you asked, the size and the risk turn orange and the panel says so.
Input parameters
Notes
It is an Expert Advisor only because MetaTrader 5 does not allow OrderCalcProfit inside indicators (error 4014). It never opens, changes or closes a trade. It runs on demo and live accounts; on a chart that already has an EA, open a second chart of the same symbol. Spread and commission are not part of the loss at the stop. Removing it deletes its objects; changing the timeframe or the inputs keeps your stop line where you left it.
Import Ticks CSV - a tick file into a custom symbol for real-tick tests
A script that reads a tick CSV into a custom symbol and builds its M1 bars, so the Strategy Tester can run "Every tick based on real ticks" over a period the broker's server does not keep. It finds the columns by name and moves UTC times to server time.
Tick Depth Probe - how far back your broker keeps real ticks
A script that shows how far back your broker's server keeps real ticks for a symbol. It samples a few short windows over the last four years, asks for each one until its ticks arrive or the time is up, and prints the oldest one that has ticks.
Safe Pyramiding - add to winning trades only when they are risk free
Decides if you can add to a running winner: only when all open trades in that direction are on break-even and the newest one is in profit. The open risk is never more than one add. Hedging accounts only.
EzoO Candle Timer - time left on the candle, live spread and today's range
Shows the time left on the current candle, the live spread and today's range next to the price or in a chart corner. Works on every timeframe.