Skip to content
All library documents

EMA 5/13 Crossover Strategy for Long and Short Trades

Article TradingView scripts

Summary

This strategy uses two exponential moving averages calculated from closing prices: a fast EMA with a default length of five bars and a slow EMA with a default length of thirteen. It opens a long position when the fast average crosses above the slow average and closes any short position at that signal. When the fast average crosses below the slow one, it opens a short position and closes any long position. Position size is set as a percentage of strategy equity, with the default at 100 percent.

The document provides executable Pine Script rules but no backtest results, market, chart timeframe, or evidence that the approach is profitable. It also specifies no stop loss, profit target, or other risk control. EMA crossovers can lag price moves and may generate repeated reversals in sideways markets, so results would depend on the traded instrument, timeframe, and execution assumptions.

Key ideas

  • A long signal occurs when the five-period EMA crosses above the thirteen-period EMA.
  • A short signal occurs when the fast EMA crosses below the slow EMA.
  • Each crossover closes the position in the opposite direction before opening the new position.
  • The default position size is 100 percent of strategy equity.
  • The script provides no performance evidence or explicit stop-loss rules.

Tags

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