Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Indicators

Lot Sentinel – drag one stop line, get the exact lot size on any symbol - indicator for MetaTrader 5

Yuya Nakamura
Yuya Nakamura
  • MQL5 / MQL4 Developer & Algo Trader at  Independent / Self-employed
  • Japan
  • 178
MQL5/MQL4 developer and algorithmic trader based in Japan.
I build Expert Advisors that I run on my own live accounts, so I write code the way a trader needs it: reliable, testable, and easy to configure.
What I can do for you
Views:
73
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Lot Sentinel guards your lot size. Drag one stop line on the chart and the panel shows the exact lot (position size) for the money you are willing to risk. It works on any symbol: forex, gold, indices, stocks and crypto.

The idea is simple: the stop loss decides the lot, not the other way round. Place the stop where the chart says it belongs, and Lot Sentinel tells you how big the position can be.

Lot Sentinel on XAUUSD H1 (BUY)


How to use
1. Attach the indicator to any chart. A red stop line appears below the price.
2. Drag the line to your stop loss level. Below the price means BUY, above the price means SELL.
3. Read the panel: position size, entry, stop distance in points, take profit, your risk and the actual risk after rounding.

How to read the panel
- POSITION SIZE: the lot to open, already rounded down to the broker's volume step.
- ACTUAL RISK: the money you lose at the stop with that lot. Rounding down means it never exceeds your setting.
- RISK USED bar: the share of your allowed risk actually used. It turns amber with a warning when even the minimum lot is above your risk.
- TAKE PROFIT: the level at your reward ratio (for example 2.0R), also drawn as a dotted line.

Why it is accurate on every symbol
The loss per lot is calculated from SYMBOL_TRADE_TICK_SIZE and SYMBOL_TRADE_TICK_VALUE_LOSS. This is the broker's own profit calculation, so the result is correct whatever the contract size, tick size or quote currency of the symbol.

Inputs
- Risk mode: % of balance, % of equity, or a fixed amount in the account currency
- Risk %: used in the two percent modes (default 1.0)
- Risk amount: used in the fixed mode (default 100)
- Initial stop distance: where the stop line is placed when the indicator starts, in points (default 300)
- Reward ratio: take profit = stop distance x ratio; 0 hides the take profit (default 2.0)
- Panel corner and font size
- Accent, BUY, SELL and stop line colors

The indicator never opens, closes or modifies trades.
SafeRequest - complete and check every MqlTradeRequest in one place SafeRequest - complete and check every MqlTradeRequest in one place

An include file that fills every field of a trade request on purpose, rounds prices to the tick grid, respects stops and freeze levels, and never removes a take profit by accident.

PostQuantumCrypto: ML-KEM (Kyber) and ML-DSA (Dilithium) post-quantum encryption keys and signatures for MQL5 PostQuantumCrypto: ML-KEM (Kyber) and ML-DSA (Dilithium) post-quantum encryption keys and signatures for MQL5

The NIST post-quantum standards in plain MQL5 with no DLL: ML-KEM to agree on a secret key, ML-DSA to sign and verify, and the SHA-3 and SHAKE functions they are built on. Every output matches NIST's official test vectors, OpenSSL and Go byte for byte.

Real Tick Coverage - where your broker's tick history exists, month by month Real Tick Coverage - where your broker's tick history exists, month by month

Estimates, month by month and for each symbol, where the broker's real tick history exists, so you can see which part of an "Every tick based on real ticks" test is likely real and which is modelled.

Identifying the highest and lowest price levels over a specific period Identifying the highest and lowest price levels over a specific period

Finds and plots the highest high and lowest low over a specified lookback period Includes a vertical lookback boundary line, price labels, and optional push notifications