Momentum Entries with Double-Momentum and EMA Filters
Summary
This script defines a configurable momentum strategy that can enter long or short positions when price momentum and a second momentum measure point in the same direction. Momentum is calculated either as a percentage change or a raw difference, with controls for the lookback length and for using single or double momentum entries. An optional exponential moving average filter is also provided, alongside date and time-window restrictions for trade entries.
The visible source includes optional percentage-based stop-loss and take-profit levels, plotting for those levels, and alert-message inputs. It sets a backtesting start date and initial capital, but the document supplies no results or evaluation of performance. The supplied source is truncated partway through the execution rules, so the complete entry and exit behavior—especially how the EMA filter is applied and how single-momentum signals are handled—cannot be established from this excerpt. The configurable controls describe a strategy framework rather than evidence that its parameters are profitable or robust.
Key ideas
- Momentum can be measured as a percentage return or as a raw price difference over a lookback period.
- Double-momentum entries require the lookback momentum and a second momentum measure to share a positive or negative sign.
- The script provides an optional EMA filter and configurable trading dates and entry-time windows.
- Percentage-based stop-loss and take-profit levels are available but disabled by default.
- The excerpt ends before the execution logic is complete and includes no performance evidence.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.