Forex_Strategy_Builder.Strategy.Clone C# (CSharp) Метод

Clone() публичный Метод

Returns a copy of the current strategy.
public Clone ( ) : Strategy
Результат Strategy
        public Strategy Clone()
        {
            // Creates a new strategy.
            Strategy tempStrategy = new Strategy(openFilters, closeFilters);

            // Number of slots
            tempStrategy.openFilters  = openFilters;
            tempStrategy.closeFilters = closeFilters;

            // Strategy name
            tempStrategy.strategyName = strategyName;

            // Description
            tempStrategy.description = description;

            // Market
            tempStrategy.symbol = symbol;
            tempStrategy.period = period;

            // Same and Opposite direction Actions
            tempStrategy.sameDirSignal = sameDirSignal;
            tempStrategy.oppDirSignal  = oppDirSignal;

            // Money Management
            tempStrategy.useAccountPercentEntry = useAccountPercentEntry;
            tempStrategy.maxOpenLots  = maxOpenLots;
            tempStrategy.entryLots    = entryLots;
            tempStrategy.addingLots   = addingLots;
            tempStrategy.reducingLots = reducingLots;

            // Permanet Stop Loss
            tempStrategy.usePermanentSL  = usePermanentSL;
            tempStrategy.permanentSLType = permanentSLType;
            tempStrategy.permanentSL     = permanentSL;

            // Permanet Take Profit
            tempStrategy.usePermanentTP  = usePermanentTP;
            tempStrategy.permanentTPType = permanentTPType;
            tempStrategy.permanentTP     = permanentTP;

            // Break Even
            tempStrategy.useBreakEven = useBreakEven;
            tempStrategy.breakEven    = breakEven;

            // Reading the slots
            for (int slot = 0; slot < Slots; slot++)
                tempStrategy.Slot[slot] = indicatorSlot[slot].Clone();

            return tempStrategy;
        }