Forex_Strategy_Builder.Strategy.AddOpenFilter C# (CSharp) Method

AddOpenFilter() public method

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

            OpenFilters++;
            IndicatorSlot[] aIndSlotOld = (IndicatorSlot[])indicatorSlot.Clone();
            indicatorSlot = new IndicatorSlot[Slots];
            int newSlotNumb = OpenFilters; // The number of new open filter slot.

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

            // Copy the close slot and all close filters.
            for (int slot = newSlotNumb + 1; slot < Slots; slot++)
                indicatorSlot[slot] = aIndSlotOld[slot-1];

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

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

            return newSlotNumb;
        }