Skip to content
All library documents

15-Minute EMA Crossover Bot with Tight Trailing Stops

Article TradingView scripts

Summary

This strategy uses crossovers between a fast and a slow EMA to generate long and short entries. It can limit signals to a 15-minute chart and weekdays, and reverses by closing the current opposing position before entering in the new direction. Each position has a fixed dollar stop and a trailing stop that activates after a preset favorable move, then follows price at a set dollar distance. The code plots the EMAs, entry level, stop, and a reconstructed trailing level, and offers entry alerts.

The script sets position size as a percentage of equity, includes leverage-related margin parameters, and assumes zero commission. Its strategy declaration disables recalculation on every tick and on order fills. The supplied document contains no strategy report, tested instrument, or performance results, so it does not establish how the rules perform. Costs, slippage, symbol tick size, and the handling of intrabar price movement can materially affect results, especially with tight stops.

Key ideas

  • EMA crossovers define the long and short entry signals.
  • The script can filter trades by chart interval and weekday.
  • A stop loss and an activation-based trailing stop manage open positions without a fixed target.
  • Reversal signals close the existing position before entering the opposite direction.
  • The document describes code and assumptions but reports no strategy performance evidence.

Tags

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