Skip to content
All library documents

Using ATR for Volatility-Adjusted Trailing Stops and Breakeven Management

Article MQL5 code base

Summary

The document presents an Expert Advisor for managing positions opened manually or by another automated system. Its trailing stop is based on Average True Range (ATR), so the stop distance can respond to changing volatility instead of remaining a fixed number of pips. The user sets an ATR lookback period and multiplier; the document cites a period of 14 and multipliers of 2.0 or 3.0 as example settings intended to reduce sensitivity to market noise.

A separate breakeven option moves the stop to the entry price, with a small allowance for commissions, after profit reaches a configurable threshold. A magic-number setting determines whether the manager handles manual positions or positions associated with a particular EA. The document describes inputs and intended behavior but supplies no code, backtest results, or evidence that its suggested settings are suitable across instruments or market conditions. A volatility-based stop also does not by itself define entries or guarantee risk control.

Key ideas

  • An ATR-based stop distance adjusts to changing market volatility.
  • The ATR lookback and multiplier determine how the trailing distance is calculated.
  • A configurable profit threshold can trigger a stop move to entry with a commission allowance.
  • A magic-number setting selects manual trades or trades from a specified EA.
  • No performance evidence or instrument-specific parameter validation is provided.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.