Forex_Strategy_Builder.Strategy.AddCloseFilter C# (CSharp) Method

AddCloseFilter() public method

Adds a new Close Filter to the strategy.
public AddCloseFilter ( ) : int
return int
        public int AddCloseFilter()
        {
            Data.Log("Adding a Close Filter");

            closeFilters++;
            IndicatorSlot[] aIndSlotOld = (IndicatorSlot[])indicatorSlot.Clone();
            indicatorSlot = new IndicatorSlot[Slots];
            int newSlotNumb = Slots - 1; // The number of new close filter slot.

            // Copy all old slots.
            for (int slot = 0; slot < newSlotNumb; slot++)
                indicatorSlot[slot] = aIndSlotOld[slot];

            // Create the new slot.
            indicatorSlot[newSlotNumb] = new IndicatorSlot();
            indicatorSlot[newSlotNumb].SlotType = SlotTypes.CloseFilter;

            // Sets the slot numbers.
            for (int slot = 0; slot < Slots; slot++)
                indicatorSlot[slot].SlotNumber = slot;

            return newSlotNumb;
        }