LFH/ Long positions using MACD histogram, long EMA and short EMA
Jan 18, 2018

The LFH/ Long positions using MACD histogram, long EMA and short EMA tool provides a systematic approach to identifying long entry and exit points by combining Exponential Moving Averages (EMA) with MACD histogram momentum analysis.
Usage
The tool is designed to identify trend reversals and momentum shifts for long positions. A buy signal is generated when the fast EMA is below the slow EMA (indicating a potential oversold condition or early trend shift), the MACD histogram is negative, and the histogram shows improving momentum (current value is greater than the previous value). Conversely, the tool closes long positions when the fast EMA is above the slow EMA, the MACD histogram is positive, and the histogram starts to decline (current value is less than the previous value).
Users can use this script to:
- Visualize the spread between two EMAs with dynamic cloud coloring.
- Identify specific long entry points based on momentum recovery.
- Automate exit strategies when upward momentum begins to fade.
Details
The script utilizes two primary technical components:
- EMA Crossover/Spread: It calculates the difference (delta) between a Fast EMA and a Slow EMA. The area between these averages is filled to indicate the current trend direction.
- MACD Histogram Momentum: It evaluates the MACD histogram (12, 26, 9) to ensure that entries occur when bearish momentum is waning and exits occur when bullish momentum is stalling.
By requiring the MACD histogram to be "less negative" for an entry, the script attempts to catch the bottom of a move rather than buying during a peak of downward velocity.
Settings
- Fast Length: Sets the period for the shorter Exponential Moving Average.
- Slow Length: Sets the period for the longer Exponential Moving Average.
FAQ
How do I access LFH/ Long positions using MACD histogram, long EMA and short EMA?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Can I use this for short positions?
The current implementation is specifically logic-coded for long entries and closing those long positions; however, the logic could be inverted for short-selling strategies.
What timeframes work best with this indicator?
While it can be applied to any timeframe, it is most commonly used on intermediate timeframes like the 1H or 4H to filter out market noise associated with lower period EMAs.
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.