Skip to content
All library documents

EMA Trend Entries with ATR-Based Stops and Risk-Multiple Targets

Article Strategy library · Author: ionplesu88

Summary

This XAUUSD strategy uses two exponential moving averages to define trade direction and a price recross to time entries. A confirmed close above the fast EMA triggers a long when that EMA is above the slow EMA; the inverse conditions trigger a short. On each signal, the script closes the opposite position and opens a new one.

The initial stop is placed 1.5 ATR from entry, and five take-profit levels are calculated at preset multiples of that stop distance. Prices are rounded to the instrument’s tick size. The script also draws entry, stop, and target labels and issues an alert with the entry and stop prices. The supplied excerpt is truncated during the short-side label code, and it gives no backtest results or evidence of profitability. It describes target levels and alerts, but does not show exit orders tied to those levels, so the code shown alone does not establish that positions are closed at the displayed targets or stop.

Key ideas

  • A fast EMA above a slow EMA defines the long trend condition, while a close crossing back above the fast EMA triggers entry.
  • Short entries use the inverse EMA alignment and a close crossing below the fast EMA.
  • The stop distance is set using an ATR multiple, and five targets are calculated as multiples of that risk distance.
  • The script rounds displayed prices to the instrument tick size and provides chart labels and entry alerts.
  • The provided excerpt does not show a backtest or enough exit logic to establish how the plotted levels affect positions.

Tags

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