Skip to content
All library documents

EMA Crossover Entries with Percentage or Fixed-Point Trailing Targets and Stops

Article TradingView scripts

Summary

This TradingView strategy enters long when a fast exponential moving average crosses above a slow one and enters short on the reverse crossover, provided it is flat. Its default EMA lengths are 20 and 50. Each entry starts with a profit target and stop-loss set either as percentages of the entry price or as fixed price distances. The script plots the averages and marks entries, current target and stop levels, and each trailing adjustment.

Trailing begins after price advances by a configurable threshold. The strategy then moves the target farther in the profitable direction, adjusts the stop, and advances the threshold for another iteration. This is an implementation example rather than a performance study: the document gives no backtest results, market specification, or evidence that the parameters are effective. The fixed-point short trailing condition appears to test for a price rise rather than a fall, so that mode may not behave as intended for short positions; the code should be checked before use.

Key ideas

  • Long and short entries are triggered by crossovers between configurable fast and slow EMAs.
  • Initial targets and stops can use percentage distances or fixed price points.
  • Once price passes a threshold, the script advances the target, stop, and next trailing threshold.
  • The document provides no performance evidence, and the fixed-point short trigger may be incorrectly oriented.

Tags

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