Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

Metatrader 5 Indicator | Risk Lot From Stop Line | MetaTrader Tool

Explore the latest free tools from the MQL5 community. Here's a new indicator, expert advisor, or script for MetaTrader.

Position size is the part of risk management that is easiest to get wrong by hand. The value of one point is different for every symbol: Forex pairs, gold, indices and CFDs all have their own contract size, tick value and volume step. This indicator does the calculation for you directly on the chart.

When the indicator starts, a dashed stop line appears one ATR below the price. Drag it to where your stop should be. The panel immediately shows the direction (stop below the price = buy, above = sell), the distance in points, the volume for your risk and the real risk after the volume is rounded to the broker's step.

Image for Risk Lot From Stop Line

Recover from drawdowns intelligently with the Auto Recovery Expert Advisor for MT4/MT5. Perfect for hedging strategies. Learn more.

Why the real risk is shown separately

The volume is always rounded DOWN to the volume step, so the risk never exceeds the plan. But on small accounts and wide stops the calculated volume can be smaller than the minimum volume. In that case the indicator shows the minimum volume and how much it really risks. If it is more than N times the planned risk (2 by default), the text turns red: the trade should be skipped or the stop moved. This situation is common on gold, where 0.01 lot with a 50 dollar stop already risks 50 dollars.

Input parameters

  • Risk, % of the base (default 1.0).
  • Base amount (default 0 = current balance). Set a fixed amount if you want the risk from a fixed base, not from the balance.
  • Warn if minimum volume risk > N x planned (default 2.0).
  • Stop line color, panel text color, panel corner, font size.

How the loss is calculated

The loss per 1.0 lot is taken from OrderCalcProfit, which uses the terminal's own calculation mode for the symbol. Before the account is connected OrderCalcProfit may return zero; then the indicator falls back to the tick value (SYMBOL_TRADE_TICK_VALUE_LOSS and SYMBOL_TRADE_TICK_SIZE). The entry price is the Ask for a buy and the Bid for a sell, so the spread is included.

The line is kept when you change the timeframe and removed together with the indicator. The indicator does not open trades.

Thanks for reading. Discover premium MetaTrader solutions at RobotFX.

80306

Best MetaTrader Indicators + Profitable Expert Advisors