Discussion of article "How to create a custom indicator (Heiken Ashi) using MQL5"

 

New article How to create a custom indicator (Heiken Ashi) using MQL5 has been published:

In this article, we will learn how to create a custom indicator using MQL5 based on our preferences, to be used in MetaTrader 5 to help us read charts or to be used in automated Expert Advisors.

The Heiken Ashi charts are similar to the normal candlestick technical charts but the calculation to plot these candles is different. Namely, there are two methods that differ. As we know, the normal candlesticks chart calculates prices based on actual open, high, low, and close prices in a specific period, but the Heiken Ashi takes into consideration the prices of the previous similar prices (open, high, low, and close) when calculating its candles.

Here is how the relevant values for Heiken Ashi are calculated:

  • Open = (open of previous candle + close of the previous candle) / 2
  • Close = (open + close + high + low of the current candle) / 4
  • High = the highest value from the high, open, or close of the current period
  • Low = the lowest value from the low, open, or close of the current period

Based on the calculation, the indicator constructs bull and bear candlesticks, and the colors of these candlesticks indicate the relevant direction of the market: if it is bullish or bearish. Below is an example that shows the traditional Japanese candlesticks and Heiken Ashi, so see the difference from a visual perspective.

 ha indicator

Author: Mohamed Abdelmaaboud

 
Great Article. Thanks
Reason: