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 | ATR Volatility Risk and Position Size Calculator HUD | MQL5 Code

Fresh MQL5 code release – perfect for enhancing your MT4/MT5 strategies.

Image for ATR Volatility Risk and Position Size Calculator HUD



Reduce lag and improve accuracy with the NonLagMA Expert Advisor for MT4/MT5. Discover it.


ATR Volatility Risk and Position Size Calculator HUD is a lightweight, zero-DLL MetaTrader 5 indicator that computes volatility-calibrated Stop-Loss and Take-Profit distances from ATR(N) alongside exact broker-normalized lot sizes for three configurable risk tiers (default: 0.5%, 1.0%, and 2.0%).




Key Features:


- Broker-Accurate Lot Sizing: Uses SYMBOL_TRADE_TICK_VALUE_LOSS (with fallback to SYMBOL_TRADE_TICK_VALUE), SYMBOL_TRADE_TICK_SIZE, and SYMBOL_VOLUME_STEP / MIN / MAX normalization so position sizes remain accurate across 5-digit FX, 3-digit JPY pairs, Metals (XAUUSD/XAGUSD), Indices, and Crypto.


- Three Configurable Risk Tiers: Simultaneously displays lot sizes and exact currency risk amounts for three user-defined risk percentages (e.g., 0.5%, 1.0%, 2.0%) based on Account Equity or Balance.


- Volatility-Calibrated SL & TP: Automatically computes Stop-Loss and Take-Profit distances in points, price units, and Reward-to-Risk ratio from the live ATR(N) reading on the active chart symbol and timeframe.


- Non-Trading Read-Only Indicator: Zero DLL imports, zero network calls, and zero automated order execution—purely an analytical on-chart risk HUD.


- Compact On-Chart HUD: Lightweight object-based panel with configurable corner placement, colors, and clean deinitialization on removal.




Input Parameters:


- ATR Period & Applied Timeframe: Controls the volatility lookback window used for distance calculations.


- SL ATR Multiplier & TP ATR Multiplier: Scales the Stop-Loss and Take-Profit distances relative to current ATR.


- Risk Tier 1 / Tier 2 / Tier 3 (%): Percentage of account capital risked per trade if stopped out at the ATR Stop-Loss distance.


- Risk Basis (Equity / Balance): Selects whether lot sizing references live Account Equity or Balance.


- HUD Appearance & Corner: Adjusts panel corner anchor, offsets, font size, and color scheme.




How to Use:


Attach the indicator to any MetaTrader 5 chart (FX, XAUUSD, Indices, or Crypto). The HUD updates automatically on new ticks and bar transitions, showing current ATR value, suggested SL/TP distances in points, and exact normalized lot sizes for each risk tier.

Thanks for reading. Discover premium MetaTrader solutions at RobotFX.

80361

Best MetaTrader Indicators + Profitable Expert Advisors