Skip to content
All library documents

Heikin-Ashi Trend Entries with ATR Trailing Exits for Gold

Article TradingView scripts

Summary

This short-term strategy uses candle direction and strength, a 20-period average, and a consolidation filter to generate long and short entries. It measures candle body against ATR and requires price to be on the relevant side of the average. A five-bar cooldown limits how soon a new signal can follow a trade. Longs can occur in an uptrend; shorts require an additional strong bearish candle condition.

Positions exit through a trailing threshold based on the highest high since a long entry or lowest low since a short entry, offset by 0.8 ATR. The script sets ATR to a 14-period calculation. Its stated volatility test compares ATR with 1.2 times itself, so for positive ATR it does not meaningfully screen high-volatility periods. The page’s description mentions dynamic stop-loss and take-profit, but the shown code implements neither. No backtest results or execution assumptions are supplied, and the Heikin-Ashi inputs shown are simplified price transformations rather than a full Heikin-Ashi calculation.

Key ideas

  • Entries require a strong candle, a trend direction check, and the absence of the defined consolidation condition.
  • Short entries additionally require a bearish candle below the trend average.
  • A five-bar cooldown is used to limit the frequency of new entries.
  • Trailing exits follow the best favorable price since entry and use an ATR-based offset.
  • The volatility condition is ineffective for positive ATR, and the code does not implement the advertised fixed stop-loss or take-profit.

Tags

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