Smart EMA Signals
Jun 23, 2021

The Smart EMA Signals indicator identifies price crossovers with an Exponential Moving Average (EMA) and evaluates the historical success of those signals based on user-defined profit targets. It serves as a comprehensive tool for both trend following and backtesting the efficacy of EMA-based entries across different timeframes.
Usage
The Usage section describes how the script can be used to identify potential entry points and assess their historical validity. When the price action crosses above the EMA, a bullish signal is plotted; conversely, a bearish signal is plotted when the price crosses below the EMA.
A unique feature of this tool is its ability to highlight "winning" signals from the past. By setting a "Take Profit %" and a "Max wait" period, the indicator looks back at historical crossover signals to see if the price reached the target within the specified candle limit. These successful trades are highlighted with a distinct orange color, allowing users to visually gauge the reliability of the EMA settings on a specific asset.
Users can also enable alerts for real-time crossover events, making it easier to monitor multiple charts for "golden opportunities" as the price interacts with the smoothed trend line.
Details
The script utilizes a multi-timeframe approach by allowing users to select an EMA timeframe independent of the current chart resolution. It employs request.security to fetch data from higher timeframes and offers a "Smooth" option to handle gaps between bars.
The "Winning" signal logic is calculated by checking if the price moved a certain percentage in the favorable direction within the offset (Max wait) period following a crossover. To prevent visual distortion during live trading, the script includes a "Disable Re-painting Signals" toggle, ensuring that historical evaluations are locked in once the bar closes.
Settings
- EMA Timeframe: Determines the timeframe from which the EMA data is pulled (e.g., Daily, Weekly).
- EMA Length: Sets the lookback period for the Exponential Moving Average calculation.
- Color EMA: Toggles the dynamic coloring of the EMA line based on price position.
- Smooth: Enables a smoother visual transition for higher timeframe EMA data.
- Max wait (in candles): The maximum number of bars allowed for the price to hit the profit target for a signal to be marked as a "win".
- Take Profit %: The percentage move required to qualify a crossover signal as successful.
- Disable Re-painting Signals: When enabled, ensures that signals are only plotted based on historical data states.
- Plot high/low/signal price: Visualizes the price levels used for the profit calculation, including the signal close and subsequent extremes.
FAQ
How do I interpret the orange signals?
The orange signals indicate historical crossovers that successfully reached the specified "Take Profit %" within the "Max wait" period.
Can I use this on any timeframe?
Yes, the indicator is designed to work on any chart timeframe, and you can even overlay a higher timeframe EMA (e.g., Daily EMA on a 1-hour chart).
How can I access Smart EMA Signals?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.