Forex_Strategy_Builder.Strategy.AdjustUsePreviousBarValue C# (CSharp) Method

AdjustUsePreviousBarValue() public method

Sets Use prv bar value automaticaly
public AdjustUsePreviousBarValue ( ) : bool
return bool
        public bool AdjustUsePreviousBarValue()
        {
            bool isSomethingChanged = false;
            if (Data.AutoUsePrvBarValue == false)
                return isSomethingChanged;

            for (int slot = 0; slot < Slots; slot++)
            {
                isSomethingChanged = SetUsePrevBarValueCheckBox(slot) ? true : isSomethingChanged;
            }

            // Reclaculates the indicators
            if (isSomethingChanged)
            {
                for (int slot = 0; slot < Slots; slot++)
                {
                    string    sIndicatorName = Data.Strategy.Slot[slot].IndicatorName;
                    SlotTypes slotType       = Data.Strategy.Slot[slot].SlotType;
                    Indicator indicator      = Indicator_Store.ConstructIndicator(sIndicatorName, slotType);

                    indicator.IndParam = Data.Strategy.Slot[slot].IndParam;

                    indicator.Calculate(slotType);

                    // Set the Data.Strategy
                    Slot[slot].IndicatorName  = indicator.IndicatorName;
                    Slot[slot].IndParam       = indicator.IndParam;
                    Slot[slot].Component      = indicator.Component;
                    Slot[slot].SeparatedChart = indicator.SeparatedChart;
                    Slot[slot].SpecValue      = indicator.SpecialValues;
                    Slot[slot].MinValue       = indicator.SeparatedChartMinValue;
                    Slot[slot].MaxValue       = indicator.SeparatedChartMaxValue;
                    Slot[slot].IsDefined      = true;
                }
            }

            return isSomethingChanged;
        }