CM_Modified_Heikin-Ashi_TrendBars

Jul 23, 2014

Static chart image
Signals
Candlestick
Moving Averages

The CM_Modified_Heikin-Ashi_TrendBars indicator provides a trend-following visualization tool that applies smoothed Heikin-Ashi calculations and Exponential Moving Average (EMA) filters to color price bars based on market momentum.

Usage

The Usage section describes how the script can be used to identify trend shifts and maintain directional bias. Traders can use the bar coloring to filter out market noise, where green bars signify a bullish trend and red bars signify a bearish trend.

The indicator is highly adaptable to different trading styles:

  • Trend Identification: By looking at the bar color, users can determine the prevailing market sentiment. A change from red to green indicates a potential bullish reversal, while a change from green to red suggests a bearish reversal.
  • Asymmetric Smoothing: Users can set different EMA values for uptrends and downtrends. For example, a trader may want a more sensitive (lower value) filter for uptrends to capture breakouts quickly, while using a less sensitive (higher value) filter for downtrends to avoid premature exits during minor pullbacks.
  • Visual Filtering: By enabling the EMA plot, users can see the specific baseline used for trend calculations, allowing them to visualize the dynamic support and resistance levels created by the smoothed Heikin-Ashi data.

Details

The script functions by calculating modified Heikin-Ashi (HA) values. It specifically computes a Heikin-Ashi Close (the average of open, high, low, and close) and a Heikin-Ashi Open (the average of the previous HA open and HA close).

The trend detection logic involves two distinct Exponential Moving Averages:

  1. An UpTrend EMA calculated using the HA Close.
  2. A DownTrend EMA calculated using the HA Open.

The script then averages these two EMAs to create a central trend line. The trend state is determined by comparing the current HLC3 (Average of High, Low, and Close) to this averaged EMA value. If the price is above the average, the trend is considered bullish; if below, it is considered bearish. This dual-EMA approach provides a smoother transition between trend states compared to standard price-based moving averages.

Settings

  • EMA UpTrend: Sets the length of the EMA used for calculating the uptrend filter. Lower values increase sensitivity to price changes.
  • EMA DownTrend: Sets the length of the EMA used for calculating the downtrend filter. Higher values make the indicator less sensitive to volatility.
  • Show EMA Trend is Based On?: Toggles the visibility of the calculated EMA line on the chart.

FAQ

How do I interpret the bar colors?

Green bars indicate that the current price (HLC3) is above the smoothed Heikin-Ashi EMA average, representing a bullish trend. Red bars indicate the price is below the average, representing a bearish trend.

Why are there separate settings for UpTrend and DownTrend EMAs?

This allows traders to customize the sensitivity of the indicator based on market conditions. Markets often move with different velocities during upward and downward cycles; separate settings allow you to fine-tune the indicator to react faster to one direction than the other.

How can I access the CM_Modified_Heikin-Ashi_TrendBars indicator?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.