Skip to content
All library documents

EMA and VWAP Crossover Entries with ATR Trailing Stops

Article TradingView scripts

Summary

This trend-following strategy enters long when a nine-period exponential moving average crosses above VWAP and enters short when it crosses below. It manages open trades with an ATR-based trailing stop whose distance and offset are both set using the ATR multiplied by a configurable factor. The chart plots the EMA, VWAP, buy and sell markers, and illustrative trailing-stop lines; alerts are also included for external automation.

The code sets position sizing as a percentage of equity and calculates on every tick, while entries are processed at bar close. The description suggests use across several asset classes and intraday timeframes, but it provides no strategy report, return statistics, transaction cost analysis, or evidence that those settings generalize. The plotted stop lines are calculated separately from the platform’s trailing exit orders, so their displayed path should not automatically be assumed to match the broker or emulator’s exact fill behavior. The crossover rules and stop parameters require market-specific testing before use.

Key ideas

  • A long signal occurs when the nine-period EMA crosses above VWAP, and a short signal occurs on the reverse cross.
  • Both directions use an ATR-scaled trailing stop with configurable ATR length and multiplier.
  • The script plots signals and stop guides and provides alerts for automation.
  • The document provides no performance or execution evidence, and plotted stop guides may differ from actual exit fills.

Tags

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