Heiken Ashi free

by qualitiedx2 in category Trend at 16/05/2012
Description

The Heikin-Ashi technique is extremely useful for making candlestick charts more readable--trends can be located more easily, and buying opportunities can be spotted at a glance. The charts are constructed in the same manner as a normal candlestick chart, with the exception of the modified bar formulas. When properly used, this technique can help you spot trends and trend changes from which you can profit!

How to install:

1) Double click on downloaded file and follow instructions

2) Add indicator from Custom menu:

3) Switch main chart to line mode:

4) Choose Black for Bear Outline color option:

Result:

28972 downloads
How to install
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class HeikenAshiSmoothed : Indicator
    {
        private IndicatorDataSeries _haOpen;
        private IndicatorDataSeries _haClose;

        [Parameter("Candle width", DefaultValue = 5)]
        public int CandleWidth { get; set; }

        [Parameter("Up color", DefaultValue = "Blue")]
        public string UpColor { get; set; }

        [Parameter("Down color", DefaultValue = "Red")]
        public string DownColor { get; set; }

        private Colors _upColor;
        private Colors _downColor;
        private bool _incorrectColors;
        private Random _random = new Random();

        protected override void Initialize()
        {
            _haOpen = CreateDataSeries();
            _haClose = CreateDataSeries();

            if (!Enum.TryParse<Colors>(UpColor, out _upColor) || !Enum.TryParse<Colors>(DownColor, out _downColor))
                _incorrectColors = true;
        }

        public override void Calculate(int index)
        {
            if (_incorrectColors)
            {
                var errorColor = _random.Next(2) == 0 ? Colors.Red : Colors.White;
                ChartObjects.DrawText("Error", "Incorrect colors", StaticPosition.Center, errorColor);
                return;
            }

            var open = MarketSeries.Open[index];
            var high = MarketSeries.High[index];
            var low = MarketSeries.Low[index];
            var close = MarketSeries.Close[index];

            var haClose = (open + high + low + close) / 4;
            double haOpen;
            if (index > 0)
                haOpen = (_haOpen[index - 1] + _haClose[index - 1]) / 2;
            else
                haOpen = (open + close) / 2;

            var haHigh = Math.Max(Math.Max(high, haOpen), haClose);
            var haLow = Math.Min(Math.Min(low, haOpen), haClose);

            var color = haOpen > haClose ? _downColor : _upColor;
            ChartObjects.DrawLine("candle" + index, index, haOpen, index, haClose, color, CandleWidth, LineStyle.Solid);
            ChartObjects.DrawLine("line" + index, index, haHigh, index, haLow, color, 1, LineStyle.Solid);

            _haOpen[index] = haOpen;
            _haClose[index] = haClose;
        }
    }
}
Comments

Malitoo - January 23, 2013 @ 10:44

Hey, need some help. How can i delite the main chart type. After install Heiken Ashi is overlayed main chart. Thanks

pipaj - March 25, 2013 @ 21:34

1) Place the HA the chart 2) Turn main chart type to line: Alt+3 3) Change the line color the same as the background color (default is black): - Right click-->color options--->Bull line (choose the color) - Right click-->color options--->Bear line (choose the color)

DimitriK - August 09, 2013 @ 14:33

Hi, could you also convert the free MT4 indicator HAMA for use with cTrader?

It stands for Heiken Ashi Moving Average.

You can see it here

It is even more powerful than Heiken Ashi, I use it exclusively with price action to trade.

If you cannot get the file contact me and I will give it to you.

Sincerely

 

spuki - December 25, 2013 @ 09:56

Здравствуйте! Почему то выше предложенный код собирается с ошибками. Целых 31! Не поможете разобраться? 

                                                                                                 С уважением Александр! 

spuki - December 25, 2013 @ 10:05

Простите за беспокойство, разобрался сам. Спасибо!

L0pg - February 16, 2014 @ 08:59

Is it possible for the HA bars to underlay instead of overlay? I would like to have HA bars, but also see the barchart so I can see the actual open and close price of each bar without having to mouse over it.

brunoamancio.ti - September 01, 2016 @ 01:02

I've added some functions for cBots developers to use HA data in their bots. 

Check out /algos/indicators/show/1452

aarundell - July 31, 2021 @ 04:11

 Can I add Heiken Ashi to ctrader on my apple iPad 

5