category Trend  at 07/10/2020

Heiken Ashi Experto


This is a Heiken Ashi with a much Better Look. This version do not changes the form of the candle but just its colors. 

It comes with the option of having at least four different colors, to distinguish from Bear and Bull candles in a Bull Trend or a Bear Trend.

It will give you a much Cleaner Vision of the candles. Enjoy!!!


Grupo CTrader em Portugues -->>

Para los que quieran participar de un Grupo CTrader en Español poder compartir estrategias, indicadores e mucho más, aquí abajo les dejo el link.

Grupo CTrader en Español -->>


using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class HeikenAshiExperto : Indicator
        [Parameter("Bull Up color", DefaultValue = "RoyalBlue")]
        public string BullUpColor { get; set; }

        [Parameter("Bull Down color", DefaultValue = "Blue")]
        public string BullDownColor { get; set; }

        [Parameter("Bear Down color", DefaultValue = "Coral")]
        public string BearDownColor { get; set; }

        [Parameter("Bear Up color", DefaultValue = "Red")]
        public string BearUpColor { get; set; }

        private Color Bull_upColor;
        private Color Bull_downColor;

        private Color Bear_downColor;
        private Color Bear_upColor;

        private IndicatorDataSeries HeikenOpen;
        private IndicatorDataSeries HeikenClose;
        public Color color;

        public DataSeries Close;
        public DataSeries Open;

        protected override void Initialize()
            Close = Bars.ClosePrices;
            Open = Bars.OpenPrices;

            HeikenOpen = CreateDataSeries();
            HeikenClose = CreateDataSeries();

            Bull_upColor = Color.FromName(BullUpColor);
            Bull_downColor = Color.FromName(BullDownColor);

            Bear_downColor = Color.FromName(BearDownColor);
            Bear_upColor = Color.FromName(BearUpColor);

        public override void Calculate(int index)
            var Heiken_Close = Bars.WeightedPrices[index];

            double Heiken_Open;
            if (index > 0)
                Heiken_Open = (HeikenOpen[index - 1] + HeikenClose[index - 1]) / 2;
                Heiken_Open = (Open[index] + Close[index]) / 2;
            if (Heiken_Open > Heiken_Close)
                if (Bars.ClosePrices[index] >= Bars.OpenPrices[index])
                    Chart.SetBarColor(index, Color.FromName(BearUpColor));
                else if (Bars.ClosePrices[index] < Bars.OpenPrices[index])
                    Chart.SetBarColor(index, Color.FromName(BearDownColor));
                if (Bars.ClosePrices[index] >= Bars.OpenPrices[index])
                    Chart.SetBarColor(index, Color.FromName(BullUpColor));
                else if (Bars.ClosePrices[index] < Bars.OpenPrices[index])
                    Chart.SetBarColor(index, Color.FromName(BullDownColor));
            HeikenOpen[index] = Heiken_Open;
            HeikenClose[index] = Heiken_Close;

TraderExperto's avatar
Renato Cavalcante

Joined 07.06.2019

  • Type: free
  • Language: C#
  • Trading Platform: cTrader Automate
  • Filename: Heiken Ashi Experto.algo
  • Rating: 5
  • Downloads: 2456
Only logged in users can post a comment
Comments not found