3 EMA + RSI with Trail Stop (LOW TF)
Dec 14, 2024

The 3 EMA + RSI with Trail Stop indicator is a trend-following momentum strategy designed to identify entry opportunities through EMA crossovers and manage risk using dynamic trailing stops and RSI thresholds. This tool is optimized for lower timeframes where capturing short-to-medium term trends is critical.
Usage
The strategy generates signals based on the alignment of three Exponential Moving Averages (10, 20, and 100). A long entry is triggered when the 10 EMA crosses above the 20 EMA while both are above the 100 EMA. Conversely, a short entry occurs when the 10 EMA crosses below the 20 EMA while both are below the 100 EMA.
The RSI is used primarily as an exit mechanism to capture profits before potential reversals. If the RSI exceeds the "Exit Long RSI" threshold (default 70), a long position is closed. If it drops below the "Exit Short RSI" threshold (default 30), a short position is closed. Additionally, a time-based exit can be enabled to close profitable trades that have been open for a specific number of bars, preventing capital from being tied up in stagnating trends.
Details
The script uses a hierarchical trend detection method:
- Trend Filter: The 100 EMA acts as the primary trend filter. Trades are only taken in the direction of this long-term average.
- Momentum Trigger: The 10 and 20 EMA crossover provides the immediate entry trigger, ensuring the trade aligns with short-term momentum.
- Risk Management: The strategy employs a dual-layer protective system. A fixed percentage stop-loss acts as a hard safety net, while a trailing stop follows the price at a user-defined distance to lock in unrealized gains as the trend progresses.
Settings
RSI
- Length: The lookback period for the RSI calculation.
- Source: The price data used for RSI (e.g., Close).
- Exit Short RSI: The level at which short positions are closed.
- Exit Long RSI: The level at which long positions are closed.
Moving Averages
- EMA A Length: Period for the fastest EMA (default 10).
- EMA B Length: Period for the medium EMA (default 20).
- EMA C Length: Period for the slow/trend-filter EMA (default 100).
Trailing Stop
- Trail Points: The distance in price points for the trailing stop to activate.
- Trail Offset: The offset used to trail the price once activated.
Stop Loss
- Fixed Stop Loss (%): The percentage distance from the entry price for the initial hard stop-loss.
Strategy
- Long/Short entries: Toggles to enable or disable specific trade directions.
- Close after X # bars: Enables a time-based exit for profitable trades.
- # bars: The number of bars to wait before the time-based exit triggers.
FAQ
How do I access 3 EMA + RSI with Trail Stop?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Can I use this on any timeframe?
While designed for lower timeframes (LOW TF), the EMA lengths and trailing stop parameters can be adjusted in the settings to suit various symbols and periodicities.
Does the strategy support pyramiding?
By default, the strategy is set to 0 pyramiding, meaning it will only hold one position in one direction at a time. Entering an opposite signal will automatically close the existing position.
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.