Skip to content
All library documents

Gold EMA Trend Entries with ATR Stops, Targets, and Risk-Based Sizing

Article TradingView scripts

Summary

This XAUUSD strategy uses the relationship between 20-period and 50-period exponential moving averages to define direction. It enters long when price crosses above the faster average while that average is above the slower one, and enters short on the inverse condition. Exits are set using ATR multiples: the stop is two ATRs from the signal price and the target is four ATRs away. Position quantity is estimated from a configurable share of strategy equity divided by the ATR-based stop distance, then rounded to two decimal places.

The script sends bar-close alert messages with the direction, stop, target, and calculated quantity, intended for connector-based execution. The provided document describes the rules and code but gives no strategy report, backtest metrics, or live-trading evidence. The sizing calculation does not show adjustments for instrument contract value, currency conversion, broker lot constraints, slippage, or transaction costs, so its risk interpretation may depend on the market and connector setup.

Key ideas

  • The strategy uses a fast and slow EMA relationship to set its directional bias.
  • Entries occur when price crosses the fast EMA in the direction of that bias.
  • ATR multiples define the initial stop and profit target.
  • Position quantity is estimated from an equity risk allowance and stop distance.
  • Connector alerts include trade direction, stop, target, and quantity, but the document gives no performance evidence.

Tags

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