protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description       = Custom.Resource.NinjaScriptIndicatorDescriptionCandlestickPattern;
                Name              = Custom.Resource.NinjaScriptIndicatorNameCandlestickPattern;
                Calculate         = Calculate.OnBarClose;
                IsOverlay         = true;
                DrawOnPricePanel  = true;
                DisplayInDataBox  = false;
                IsAutoScale       = false;
                PaintPriceMarkers = false;
                Pattern           = ChartPattern.MorningStar;
                ShowAlerts        = true;
                ShowPatternCount  = true;
                TrendStrength     = 4;
                TextFont          = new Gui.Tools.SimpleFont()
                {
                    Size = 14
                };

                downColor = Brushes.DimGray;
                upColor   = Brushes.DimGray;
                textColor = Brushes.DimGray;

                AddPlot(Brushes.Transparent, Custom.Resource.CandlestickPatternFound);
            }
            else if (State == State.Configure)
            {
                if (Calculate == Calculate.OnEachTick || Calculate == Calculate.OnPriceChange)
                {
                    Calculate = Calculate.OnBarClose;
                }
            }
            else if (State == State.DataLoaded)
            {
                logic = new CandleStickPatternLogic(this, TrendStrength);
            }
            else if (State == State.Historical)
            {
                if (ChartControl != null)
                {
                    downColor = ChartControl.Properties.AxisPen.Brush;                           // Get the color of the chart axis brush
                    textColor = ChartControl.Properties.ChartText;
                }

                if (((SolidColorBrush)downColor).Color == ((SolidColorBrush)upColor).Color)
                {
                    upColor = Brushes.Transparent;
                }
                else
                {
                    upColor = Brushes.DimGray;
                }
            }
        }