/// <summary>
        /// anaCurrentMonthOHLV43.
        /// </summary>
        /// <returns></returns>
        public Indicator.anaCurrentMonthOHLV43 anaCurrentMonthOHLV43(Data.IDataSeries input, anaSessionTypeCM43 currentSession, int factorMonthlyRange, int factorNoiseBands, int rangePeriod1, int rangePeriod2, anaSessionCountCM43 selectedSession, bool showCurrentOpen, bool showFibonacci, bool showHiLo, bool showMidline, bool showNoiseLevels, bool showTargetLevels, anaTargetTypeCM43 targetType)
        {
            if (InInitialize && input == null)
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

            return _indicator.anaCurrentMonthOHLV43(input, currentSession, factorMonthlyRange, factorNoiseBands, rangePeriod1, rangePeriod2, selectedSession, showCurrentOpen, showFibonacci, showHiLo, showMidline, showNoiseLevels, showTargetLevels, targetType);
        }
		/// <summary>
		/// </summary>
		protected override void OnStartUp()
		{
			if (Instrument.MasterInstrument.InstrumentType == InstrumentType.Future &&
				(Instrument.MasterInstrument.Name == "EMD" ||Instrument.MasterInstrument.Name == "ES" || Instrument.MasterInstrument.Name == "NQ" 
				||Instrument.MasterInstrument.Name == "YM"||Instrument.MasterInstrument.Name == "GE" ||Instrument.MasterInstrument.Name == "SR" 
				||Instrument.MasterInstrument.Name == "UB"||Instrument.MasterInstrument.Name == "ZB" ||Instrument.MasterInstrument.Name == "ZF"
				||Instrument.MasterInstrument.Name == "ZN"||Instrument.MasterInstrument.Name == "ZQ" ||Instrument.MasterInstrument.Name == "ZT"
				||Instrument.MasterInstrument.Name == "6A"||Instrument.MasterInstrument.Name == "6B" ||Instrument.MasterInstrument.Name == "6C"
				||Instrument.MasterInstrument.Name == "6E"||Instrument.MasterInstrument.Name == "6J" ||Instrument.MasterInstrument.Name == "6M"
				||Instrument.MasterInstrument.Name == "6N"||Instrument.MasterInstrument.Name == "6S" ||Instrument.MasterInstrument.Name == "E7"
				||Instrument.MasterInstrument.Name == "J7"||Instrument.MasterInstrument.Name == "M6A" ||Instrument.MasterInstrument.Name == "M6B" 
				||Instrument.MasterInstrument.Name == "M6C"||Instrument.MasterInstrument.Name == "M6E" ||Instrument.MasterInstrument.Name == "M6J"
				||Instrument.MasterInstrument.Name == "M6S"||Instrument.MasterInstrument.Name == "CL" ||Instrument.MasterInstrument.Name == "EH"
				||Instrument.MasterInstrument.Name == "GC"||Instrument.MasterInstrument.Name == "HG" ||Instrument.MasterInstrument.Name == "HO"
				||Instrument.MasterInstrument.Name == "NG"||Instrument.MasterInstrument.Name == "QG" ||Instrument.MasterInstrument.Name == "QM"
				||Instrument.MasterInstrument.Name == "RB"||Instrument.MasterInstrument.Name == "SI" ||Instrument.MasterInstrument.Name == "YG" 
				||Instrument.MasterInstrument.Name == "YI"||Instrument.MasterInstrument.Name == "GF" ||Instrument.MasterInstrument.Name == "GPB"
				||Instrument.MasterInstrument.Name == "HE"||Instrument.MasterInstrument.Name == "LE" ||Instrument.MasterInstrument.Name == "YC"
				||Instrument.MasterInstrument.Name == "YK"||Instrument.MasterInstrument.Name == "YW" ||Instrument.MasterInstrument.Name == "ZC"
				||Instrument.MasterInstrument.Name == "ZE"||Instrument.MasterInstrument.Name == "ZL" ||Instrument.MasterInstrument.Name == "ZM"
				||Instrument.MasterInstrument.Name == "ZO"||Instrument.MasterInstrument.Name == "ZR" ||Instrument.MasterInstrument.Name == "ZS"
				||Instrument.MasterInstrument.Name == "ZW"))				
				isGlobex = true;
			if (isGlobex)
			{
				publicHoliday[0] = publicHoliday0;
				publicHoliday[1] = publicHoliday1;
				publicHoliday[2] = publicHoliday2;
			}			
			else for(int i=0; i<3; i++)
				publicHoliday[i] = Cbi.Globals.MinDate;

			displayFactor = 1;
			if (Instrument.MasterInstrument.InstrumentType == Cbi.InstrumentType.Currency || Instrument.MasterInstrument.Name == "DX"|| Instrument.MasterInstrument.Name == "6A"
				|| Instrument.MasterInstrument.Name == "6B" || Instrument.MasterInstrument.Name == "6C" ||Instrument.MasterInstrument.Name == "6E"
				|| Instrument.MasterInstrument.Name == "6J" || Instrument.MasterInstrument.Name == "6M" || Instrument.MasterInstrument.Name == "6S"
				|| Instrument.MasterInstrument.Name == "6N" || Instrument.MasterInstrument.Name == "E7" || Instrument.MasterInstrument.Name == "J7"
				|| Instrument.MasterInstrument.Name == "M6A" || Instrument.MasterInstrument.Name == "M6B" || Instrument.MasterInstrument.Name == "M6C"
				|| Instrument.MasterInstrument.Name == "M6E" || Instrument.MasterInstrument.Name == "M6J" || Instrument.MasterInstrument.Name == "M6S")
			{
				isCurrency = true;
				if (Instrument.MasterInstrument.Name == "6J")
					displayFactor = 1000000;
				else if (Instrument.MasterInstrument.Name == "USDJPY" || Instrument.MasterInstrument.Name == "EURJPY")
					displayFactor = 100;
				else
					displayFactor = 10000;
			}
			if (selectedSession == anaSessionCountCM43.Auto)
			{
				if (isCurrency)
					activeSession = anaSessionCountCM43.Third;
				else
					activeSession = anaSessionCountCM43.Second;
			}
			else 
				activeSession = selectedSession; 
			if(showRangeData == anaDataLocationCM43.Left_Format_Long || showRangeData == anaDataLocationCM43.Right_Format_Long || showRangeData == anaDataLocationCM43.Center_Format_Long) 
			{
				if (currentSession == anaSessionTypeCM43.ETH)
				{
					if(targetType== anaTargetTypeCM43.Average_Monthly_Range)
					{
						rangeText0 = "Current Monthly Range ETH = ";
						rangeText1 = "Average Monthly Range [" + rangePeriod1 + "] = ";
						rangeText2 = "Average Monthly Range [" + rangePeriod2 + "] = ";
					}
					else
					{
						rangeText0 = "Current Monthly Expansion ETH = ";
						rangeText1 = "Average Monthly Expansion [" + rangePeriod1 + "] = ";
						rangeText2 = "Average Monthly Expansion [" + rangePeriod2 + "] = ";
					}
					noiseText0 = "Current Monthly Noise ETH = ";
					noiseText1 = "Average Monthly Noise [" + rangePeriod1 + "] = ";
					noiseText2 = "Average Monthly Noise [" + rangePeriod2 + "] = ";
					rthOHL = false;
				}
				else
				{
					if(targetType== anaTargetTypeCM43.Average_Monthly_Range)
					{
						rangeText0 = "Current Monthly Range RTH = ";
						rangeText1 = "Average Monthly Range [" + rangePeriod1 + "] = ";
						rangeText2 = "Average Monthly Range [" + rangePeriod2 + "] = ";
					}
					else
					{
						rangeText0 = "Current Monthly Expansion RTH = ";
						rangeText1 = "Average Monthly Expansion [" + rangePeriod1 + "] = ";
						rangeText2 = "Average Monthly Expansion [" + rangePeriod2 + "] = ";
					}
					noiseText0 = "Current Monthly Noise RTH = ";
					noiseText1 = "Average Monthly Noise [" + rangePeriod1 + "] = ";
					noiseText2 = "Average Monthly Noise [" + rangePeriod2 + "] = ";
					rthOHL = true;
				}
			}
			else if(showRangeData == anaDataLocationCM43.Left_Format_Short || showRangeData == anaDataLocationCM43.Right_Format_Short || showRangeData == anaDataLocationCM43.Center_Format_Short) 
			{
				if (currentSession == anaSessionTypeCM43.ETH)
				{
					if(targetType== anaTargetTypeCM43.Average_Monthly_Range)
					{
						rangeText0 = "CMR ETH = ";
						rangeText1 = "AMR [" + rangePeriod1 + "] = ";
						rangeText2 = "AMR [" + rangePeriod2 + "] = ";
					}
					else
					{
						rangeText0 = "CME ETH = ";
						rangeText1 = "AME [" + rangePeriod1 + "] = ";
						rangeText2 = "AME [" + rangePeriod2 + "] = ";
					}
					noiseText0 = "CMN ETH = ";
					noiseText1 = "AMN [" + rangePeriod1 + "] = ";
					noiseText2 = "AMN [" + rangePeriod2 + "] = ";
					rthOHL = false;
				}
				else
				{
					if(targetType== anaTargetTypeCM43.Average_Monthly_Range)
					{
						rangeText0 = "CMR RTH = ";
						rangeText1 = "AMR [" + rangePeriod1 + "] = ";
						rangeText2 = "AMR [" + rangePeriod2 + "] = ";
					}
					else
					{
						rangeText0 = "CME RTH = ";
						rangeText1 = "AME [" + rangePeriod1 + "] = ";
						rangeText2 = "AME [" + rangePeriod2 + "] = ";
					}
					noiseText0 = "CMN RTH = ";
					noiseText1 = "AMN [" + rangePeriod1 + "] = ";
					noiseText2 = "AMN [" + rangePeriod2 + "] = ";
					rthOHL = true;
				}
			}
			else
			{
				if (currentSession == anaSessionTypeCM43.ETH)
					rthOHL = false;
				else
					rthOHL = true;
			}
			if(targetType == anaTargetTypeCM43.Average_Monthly_Range)
			{
				Plots[10].Name = "AMR-High";
				Plots[11].Name = "AMR-Low";
			}				
			else	
			{
				Plots[10].Name = "AME-High";
				Plots[11].Name = "AME-Low";
			}				
			labelFont = new Font ("Arial", labelFontSize);
			textFont = new Font ("Arial", textFontSize);
			textBrush = new SolidBrush(textColor);
			noiseBrush = new SolidBrush(Color.FromArgb(25 * opacityN, noiseBandColor));
			targetBrush = new SolidBrush(Color.FromArgb(25 * opacityT, targetBandColor));
			dataBrush = new SolidBrush(Color.FromArgb(25 * opacityD, dataTableColor));
			if (!showCurrentOpen || openColor == Color.Transparent)
				plotCurrentOpen = false;
			else
				plotCurrentOpen = true;
			if (!showHiLo && (highColor == Color.Transparent && lowColor == Color.Transparent))
				plotHiLo = false;
			else
				plotHiLo = true;
			if (!showMidline && midlineColor == Color.Transparent)
				plotMidline = false;
			else
				plotMidline = true;
			if (!showFibonacci || fibColor == Color.Transparent)
				plotFibonacci = false;
			else
				plotFibonacci = true;
			if (!showNoiseLevels || noiseBandColor == Color.Transparent)
				plotNoiseLevels = false;
			else
				plotNoiseLevels = true;
			if (!showTargetLevels || targetBandColor == Color.Transparent)
				plotTargetLevels = false;
			else
				plotTargetLevels = true;			
			if (ShowCurrentOpen)
				Plots[0].Pen.Color = openColor;
			else
				Plots[0].Pen.Color = Color.Transparent;
			if (ShowHiLo)
			{
				Plots[1].Pen.Color = highColor;
				Plots[2].Pen.Color = lowColor;
			}
			else
			{
				Plots[1].Pen.Color = Color.Transparent;
				Plots[2].Pen.Color = Color.Transparent;
			}
			if(ShowMidline)
				Plots[3].Pen.Color = midlineColor;
			else
				Plots[3].Pen.Color = Color.Transparent;
			if (ShowFibonacci)
			{
				Plots[4].Pen.Color = fibColor;
				Plots[5].Pen.Color = fibColor;
				Plots[6].Pen.Color = fibColor;
				Plots[7].Pen.Color = fibColor;
			}
			else
			{
				Plots[4].Pen.Color = Color.Transparent;
				Plots[5].Pen.Color = Color.Transparent;
				Plots[6].Pen.Color = Color.Transparent;
				Plots[7].Pen.Color = Color.Transparent;
			}
			if (ShowNoiseLevels)
			{
				Plots[8].Pen.Color = noiseBandColor;
				Plots[9].Pen.Color = noiseBandColor;
			}
			else
			{
				Plots[8].Pen.Color = Color.Transparent;
				Plots[9].Pen.Color = Color.Transparent;
			}
			if(ShowTargetLevels)
			{
				Plots[10].Pen.Color = targetBandColor;
				Plots[11].Pen.Color = targetBandColor;
			}
			else
			{
				Plots[10].Pen.Color = Color.Transparent;
				Plots[11].Pen.Color = Color.Transparent;
			}
			Plots[0].Pen.Width = plot0Width;
			Plots[0].Pen.DashStyle = dash0Style;
			for (int i = 1; i < 3; i++)
			{
				Plots[i].Pen.Width = plot1Width;
				Plots[i].Pen.DashStyle = dash1Style;
			}
			for (int i = 3; i < 8; i++)
			{
				Plots[i].Pen.Width = plot3Width;
				Plots[i].Pen.DashStyle = dash3Style;
			}			
			for (int i = 8; i< 12; i++)
			{
				Plots[i].Pen.Width = plot8Width;
				Plots[i].Pen.DashStyle = dash8Style;
			}				
			rangePeriod = Math.Max(rangePeriod1, rangePeriod2);
			if(ChartControl != null)
			{
				errorBrush.Color = ChartControl.AxisColor;
				errorData5 = errorData5 + (rangePeriod + 1)+ errorData5b;
			}
			if (Instrument.MasterInstrument.InstrumentType == Cbi.InstrumentType.Currency && (TickSize == 0.00001 || TickSize == 0.001))
				displaySize = 5* TickSize;
			else
				displaySize = TickSize;
			if (AutoScale)
				AutoScale = false;
			if(Displacement != 0)
				Displacement = 0;
			noiseList  = new List<double>();
			rangeList  = new List<double>();
			for (int i=0; i < rangePeriod; i++)
			{
				noiseList.Add(0.0);
				rangeList.Add(0.0);
			}
			if (!Bars.BarsType.IsIntraday || BarsPeriod.Id == PeriodType.Minute || BarsPeriod.Id == PeriodType.Second)
				tickBuilt = false;
			else
				tickBuilt = true;
			countDown = 0;
			monthCount = 0;
		}
 public Indicator.anaCurrentMonthOHLV43 anaCurrentMonthOHLV43(anaSessionTypeCM43 currentSession, int factorMonthlyRange, int factorNoiseBands, int rangePeriod1, int rangePeriod2, anaSessionCountCM43 selectedSession, bool showCurrentOpen, bool showFibonacci, bool showHiLo, bool showMidline, bool showNoiseLevels, bool showTargetLevels, anaTargetTypeCM43 targetType)
 {
     return _indicator.anaCurrentMonthOHLV43(Input, currentSession, factorMonthlyRange, factorNoiseBands, rangePeriod1, rangePeriod2, selectedSession, showCurrentOpen, showFibonacci, showHiLo, showMidline, showNoiseLevels, showTargetLevels, targetType);
 }
        /// <summary>
        /// anaCurrentMonthOHLV43.
        /// </summary>
        /// <returns></returns>
        public anaCurrentMonthOHLV43 anaCurrentMonthOHLV43(Data.IDataSeries input, anaSessionTypeCM43 currentSession, int factorMonthlyRange, int factorNoiseBands, int rangePeriod1, int rangePeriod2, anaSessionCountCM43 selectedSession, bool showCurrentOpen, bool showFibonacci, bool showHiLo, bool showMidline, bool showNoiseLevels, bool showTargetLevels, anaTargetTypeCM43 targetType)
        {
            if (cacheanaCurrentMonthOHLV43 != null)
                for (int idx = 0; idx < cacheanaCurrentMonthOHLV43.Length; idx++)
                    if (cacheanaCurrentMonthOHLV43[idx].CurrentSession == currentSession && cacheanaCurrentMonthOHLV43[idx].FactorMonthlyRange == factorMonthlyRange && cacheanaCurrentMonthOHLV43[idx].FactorNoiseBands == factorNoiseBands && cacheanaCurrentMonthOHLV43[idx].RangePeriod1 == rangePeriod1 && cacheanaCurrentMonthOHLV43[idx].RangePeriod2 == rangePeriod2 && cacheanaCurrentMonthOHLV43[idx].SelectedSession == selectedSession && cacheanaCurrentMonthOHLV43[idx].ShowCurrentOpen == showCurrentOpen && cacheanaCurrentMonthOHLV43[idx].ShowFibonacci == showFibonacci && cacheanaCurrentMonthOHLV43[idx].ShowHiLo == showHiLo && cacheanaCurrentMonthOHLV43[idx].ShowMidline == showMidline && cacheanaCurrentMonthOHLV43[idx].ShowNoiseLevels == showNoiseLevels && cacheanaCurrentMonthOHLV43[idx].ShowTargetLevels == showTargetLevels && cacheanaCurrentMonthOHLV43[idx].TargetType == targetType && cacheanaCurrentMonthOHLV43[idx].EqualsInput(input))
                        return cacheanaCurrentMonthOHLV43[idx];

            lock (checkanaCurrentMonthOHLV43)
            {
                checkanaCurrentMonthOHLV43.CurrentSession = currentSession;
                currentSession = checkanaCurrentMonthOHLV43.CurrentSession;
                checkanaCurrentMonthOHLV43.FactorMonthlyRange = factorMonthlyRange;
                factorMonthlyRange = checkanaCurrentMonthOHLV43.FactorMonthlyRange;
                checkanaCurrentMonthOHLV43.FactorNoiseBands = factorNoiseBands;
                factorNoiseBands = checkanaCurrentMonthOHLV43.FactorNoiseBands;
                checkanaCurrentMonthOHLV43.RangePeriod1 = rangePeriod1;
                rangePeriod1 = checkanaCurrentMonthOHLV43.RangePeriod1;
                checkanaCurrentMonthOHLV43.RangePeriod2 = rangePeriod2;
                rangePeriod2 = checkanaCurrentMonthOHLV43.RangePeriod2;
                checkanaCurrentMonthOHLV43.SelectedSession = selectedSession;
                selectedSession = checkanaCurrentMonthOHLV43.SelectedSession;
                checkanaCurrentMonthOHLV43.ShowCurrentOpen = showCurrentOpen;
                showCurrentOpen = checkanaCurrentMonthOHLV43.ShowCurrentOpen;
                checkanaCurrentMonthOHLV43.ShowFibonacci = showFibonacci;
                showFibonacci = checkanaCurrentMonthOHLV43.ShowFibonacci;
                checkanaCurrentMonthOHLV43.ShowHiLo = showHiLo;
                showHiLo = checkanaCurrentMonthOHLV43.ShowHiLo;
                checkanaCurrentMonthOHLV43.ShowMidline = showMidline;
                showMidline = checkanaCurrentMonthOHLV43.ShowMidline;
                checkanaCurrentMonthOHLV43.ShowNoiseLevels = showNoiseLevels;
                showNoiseLevels = checkanaCurrentMonthOHLV43.ShowNoiseLevels;
                checkanaCurrentMonthOHLV43.ShowTargetLevels = showTargetLevels;
                showTargetLevels = checkanaCurrentMonthOHLV43.ShowTargetLevels;
                checkanaCurrentMonthOHLV43.TargetType = targetType;
                targetType = checkanaCurrentMonthOHLV43.TargetType;

                if (cacheanaCurrentMonthOHLV43 != null)
                    for (int idx = 0; idx < cacheanaCurrentMonthOHLV43.Length; idx++)
                        if (cacheanaCurrentMonthOHLV43[idx].CurrentSession == currentSession && cacheanaCurrentMonthOHLV43[idx].FactorMonthlyRange == factorMonthlyRange && cacheanaCurrentMonthOHLV43[idx].FactorNoiseBands == factorNoiseBands && cacheanaCurrentMonthOHLV43[idx].RangePeriod1 == rangePeriod1 && cacheanaCurrentMonthOHLV43[idx].RangePeriod2 == rangePeriod2 && cacheanaCurrentMonthOHLV43[idx].SelectedSession == selectedSession && cacheanaCurrentMonthOHLV43[idx].ShowCurrentOpen == showCurrentOpen && cacheanaCurrentMonthOHLV43[idx].ShowFibonacci == showFibonacci && cacheanaCurrentMonthOHLV43[idx].ShowHiLo == showHiLo && cacheanaCurrentMonthOHLV43[idx].ShowMidline == showMidline && cacheanaCurrentMonthOHLV43[idx].ShowNoiseLevels == showNoiseLevels && cacheanaCurrentMonthOHLV43[idx].ShowTargetLevels == showTargetLevels && cacheanaCurrentMonthOHLV43[idx].TargetType == targetType && cacheanaCurrentMonthOHLV43[idx].EqualsInput(input))
                            return cacheanaCurrentMonthOHLV43[idx];

                anaCurrentMonthOHLV43 indicator = new anaCurrentMonthOHLV43();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.CurrentSession = currentSession;
                indicator.FactorMonthlyRange = factorMonthlyRange;
                indicator.FactorNoiseBands = factorNoiseBands;
                indicator.RangePeriod1 = rangePeriod1;
                indicator.RangePeriod2 = rangePeriod2;
                indicator.SelectedSession = selectedSession;
                indicator.ShowCurrentOpen = showCurrentOpen;
                indicator.ShowFibonacci = showFibonacci;
                indicator.ShowHiLo = showHiLo;
                indicator.ShowMidline = showMidline;
                indicator.ShowNoiseLevels = showNoiseLevels;
                indicator.ShowTargetLevels = showTargetLevels;
                indicator.TargetType = targetType;
                Indicators.Add(indicator);
                indicator.SetUp();

                anaCurrentMonthOHLV43[] tmp = new anaCurrentMonthOHLV43[cacheanaCurrentMonthOHLV43 == null ? 1 : cacheanaCurrentMonthOHLV43.Length + 1];
                if (cacheanaCurrentMonthOHLV43 != null)
                    cacheanaCurrentMonthOHLV43.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheanaCurrentMonthOHLV43 = tmp;
                return indicator;
            }
        }