Forex_Strategy_Builder.Indicator_Dialog.SetClosingLogicConditions C# (CSharp) Method

SetClosingLogicConditions() private method

Sets or restores the closing logic conditions.
private SetClosingLogicConditions ( ) : void
return void
        private void SetClosingLogicConditions()
        {
            bool isClosingFiltersAllowed = Indicator_Store.ClosingIndicatorsWithClosingFilters.Contains(indicatorName);

            // Removes or recovers closing logic slots.
            if (slotType == SlotTypes.Close && !isClosingFiltersAllowed && Data.Strategy.CloseFilters > 0)
            {   // Removes all the closing logic conditions.
                Data.Strategy.RemoveAllCloseFilters();
                closingSlotsRemoved = true;
            }
            else if (slotType == SlotTypes.Close && isClosingFiltersAllowed && closingSlotsRemoved)
            {
                foreach (IndicatorSlot inslot in closingConditions)
                {   // Recovers all the closing logic conditions.
                    Data.Strategy.AddCloseFilter();
                    Data.Strategy.Slot[Data.Strategy.Slots - 1] = inslot.Clone();
                }
                closingSlotsRemoved = false;
            }

            return;
        }