EMA Crossover Signals with Trend Filters and ATR Stops
Summary
This script generates long and short signals from fast and slow EMA crossovers, with volume or recent price direction as an additional condition. A trend filter accepts either ADX above a threshold or a sufficiently large gap between positive and negative directional indicators. Traders can choose long-only, short-only, or both directions. When a crossover signals the opposite side of an open trade, the script closes the position and enters in the new direction.
Open positions use ATR-based stop levels alongside a maximum loss percentage. The source also calculates DMI reversal signals, but the described exit-and-flip paths for those signals are commented out, so they are inactive. The document supplies code and default settings but no market, timeframe, backtest results, or evidence of profitability. EMA crossovers can lag or whipsaw, and the trend and stop settings would need testing for a chosen market. Volume and price filters, position sizing, and exit behavior also affect the strategy's realized risk and results.
Key ideas
- EMA crossovers form the core long and short entry signals.
- A trend filter uses ADX strength or separation between directional indicators.
- Volume or recent price direction must also support a crossover signal.
- ATR-based stops are combined with a maximum loss percentage for open positions.
- DMI reversal exits are calculated but commented out, and no backtest evidence is supplied.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.