All indicators

Heiken Ashi Candles

May 13, 2017

Static chart image
SignalsCandlestick

The Heiken Ashi Candles indicator provides a visual overlay of smoothed price action on the chart, enabling traders to filter market noise and identify trend direction with greater clarity.

Usage

The Usage section describes how the script can be used to improve chart analysis and strategy development. This tool is primarily used to identify the prevailing market trend by neutralizing minor price fluctuations through the Heiken Ashi averaging method.

Traders can use this indicator to:

  • Identify Trend Direction: Bullish trends are represented by green candles (where the Heiken Ashi close is above the open), while bearish trends are represented by red candles (where the Heiken Ashi close is below the open).
  • Confirm Reversals: The script includes built-in alert conditions for trend changes. A bullish trend start is identified when the Heiken Ashi close crosses over the open, while a bearish trend start occurs when it crosses under.
  • Strategy Development: By using the variables provided in this script, developers can build backtesting strategies that rely on Heiken Ashi logic to define entries and exits, ensuring the data processed by the strategy engine matches the visual smoothed candles.

Details

The Heiken Ashi Candles script utilizes the ticker.heikinashi() function to retrieve smoothed price data. Unlike standard Japanese candlesticks which use the actual Open, High, Low, and Close (OHLC) of a specific period, Heiken Ashi candles are calculated based on averages of the current and previous bars.

The script execution involves fetching the requested data via request.security, ensuring that the smoothed values are mapped correctly to the current chart timeframe. This implementation is refactored for performance and includes optimized alert triggers to notify users of trend shifts immediately upon a bar close.

Settings

  • HA Candles: A boolean toggle that determines whether the indicator displays Heiken Ashi data or reverts to the standard ticker data. When enabled, the ticker.heikinashi data is requested; when disabled, the script plots standard price values.

FAQ

How do Heiken Ashi candles differ from standard candlesticks? Standard candlesticks represent the actual market prices for a given period. Heiken Ashi candles use an averaging formula (Open + High + Low + Close / 4) to determine the candle body and wicks, which results in a smoother visual representation that makes trends easier to spot.

Can I set alerts for trend changes with this tool? Yes, the script includes logic to trigger alerts when a crossover or crossunder occurs between the Heiken Ashi open and close prices, signifying a potential change in trend direction.

How can I access the Heiken Ashi Candles indicator? 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.