Skip to main content
Version: 3.0

Example C1: Average true range stop loss trailing

caution

This is not a ready-to-use trading strategy. A trading strategy requires adjustment to the timeframe and symbol, along with thorough backtesting. The example is intended as a foundation for your own custom strategy and to help you get familiar with the Expert Advisor Builder web application. To import and use an example, please follow the instructions provided here.

Description

This example showcases basic ATR-based trailing stop loss functionality. The stop loss continuously adjusts based on Average True Range values, maintaining a dynamic distance from current price that adapts to market volatility. The trailing activation begins immediately at position opening, protecting the trade from the start.

The forward adjustment of 3.50 multiplies the raw ATR value, creating sufficient breathing room for normal price fluctuations. As volatility increases, the stop loss automatically widens its distance; as markets calm, it tightens. This responsive behavior prevents both premature exits and excessive risk exposure.

The low 1.10 risk ratio take profit creates a tight target suitable for volatile conditions. This combination of adaptive stops and modest targets works well in trending markets where prices move steadily but with varying volatility levels.

Recreate the Example

You can either import this example directly or set it up manually. To manually replicate the trading module, make sure a newly added module includes the following key settings and that the professional mode is activated:

Trade Basics

  • Operation type = Long

Signal Generation - Indicators (MACD Main line)

  • Signal in use = On
  • Signal used for = Entry
  • Selected indicator = MACD
  • Line index = Main line
  • Draw in chart = On
  • Drawing slot = 1

Signal Generation - Indicators (MACD Signal line)

  • Signal in use = On
  • Signal used for = Entry
  • Selected indicator = MACD
  • Line index = Signal line
  • Draw in chart = On
  • Drawing slot = 2

Signal Generation - Indicators - ATR

  • Signal in use = On
  • Signal used for = Forward
  • Selected indicator = ATR
  • Draw in chart = On
  • Drawing slot = 3
  • Forward adjustment = 3.50

Signal Generation - Indicator Combinations (MACD Main line & MACD Signal line)

  • Signal in use = On
  • Signal used for = Entry
  • Input indicator 1 = MACD (Main line)
  • Input indicator 2 = MACD (Signal line)
  • Value relation = Value x cross value x

Initial Stop Loss

  • Selection = Indicator value
  • Used indicator = ATR

Stop Loss Trailing - Indicator value

  • Activation position = 0
  • Type = Indicator value
  • Used indicator = ATR

Initial Take Profit

  • Selection = Risk ratio
  • Risk ratio = 1.10

Screenshots

Example C1: Average true range stop loss trailing.webp