Example #1
0
// ---------------------------------------------------------- //

        /// <summary>
        /// Edits the Strategy Properties Slot
        /// </summary>
        void EditStrategyProperties()
        {
            Strategy_Properties strprp = new Strategy_Properties();

            strprp.SameDirAverg           = Data.Strategy.SameSignalAction;
            strprp.OppDirAverg            = Data.Strategy.OppSignalAction;
            strprp.UseAccountPercentEntry = Data.Strategy.UseAccountPercentEntry;
            strprp.MaxOpenLots            = Data.Strategy.MaxOpenLots;
            strprp.EntryLots       = Data.Strategy.EntryLots;
            strprp.AddingLots      = Data.Strategy.AddingLots;
            strprp.ReducingLots    = Data.Strategy.ReducingLots;
            strprp.UsePermanentSL  = Data.Strategy.UsePermanentSL;
            strprp.PermanentSLType = Data.Strategy.PermanentSLType;
            strprp.PermanentSL     = Data.Strategy.PermanentSL;
            strprp.UsePermanentTP  = Data.Strategy.UsePermanentTP;
            strprp.PermanentTPType = Data.Strategy.PermanentTPType;
            strprp.PermanentTP     = Data.Strategy.PermanentTP;
            strprp.UseBreakEven    = Data.Strategy.UseBreakEven;
            strprp.BreakEven       = Data.Strategy.BreakEven;
            strprp.SetParams();
            strprp.ShowDialog();

            if (strprp.DialogResult == DialogResult.OK)
            {
                OnStrategyChange();

                Data.StackStrategy.Push(Data.Strategy.Clone());

                Data.Strategy.SameSignalAction       = strprp.SameDirAverg;
                Data.Strategy.OppSignalAction        = strprp.OppDirAverg;
                Data.Strategy.UseAccountPercentEntry = strprp.UseAccountPercentEntry;
                Data.Strategy.MaxOpenLots            = strprp.MaxOpenLots;
                Data.Strategy.EntryLots       = strprp.EntryLots;
                Data.Strategy.AddingLots      = strprp.AddingLots;
                Data.Strategy.ReducingLots    = strprp.ReducingLots;
                Data.Strategy.UsePermanentSL  = strprp.UsePermanentSL;
                Data.Strategy.PermanentSLType = strprp.PermanentSLType;
                Data.Strategy.PermanentSL     = strprp.PermanentSL;
                Data.Strategy.UsePermanentTP  = strprp.UsePermanentTP;
                Data.Strategy.PermanentTPType = strprp.PermanentTPType;
                Data.Strategy.PermanentTP     = strprp.PermanentTP;
                Data.Strategy.UseBreakEven    = strprp.UseBreakEven;
                Data.Strategy.BreakEven       = strprp.BreakEven;

                RebuildStrategyLayout();
                SetSrategyOverview();

                Data.IsStrategyChanged = true;

                CalculateStrategy(false);
            }

            return;
        }
        // ---------------------------------------------------------- //
        /// <summary>
        /// Edits the Strategy Properties Slot
        /// </summary>
        void EditStrategyProperties()
        {
            Strategy_Properties strprp = new Strategy_Properties();
            strprp.SameDirAverg    = Data.Strategy.SameSignalAction;
            strprp.OppDirAverg     = Data.Strategy.OppSignalAction;
            strprp.UseAccountPercentEntry = Data.Strategy.UseAccountPercentEntry;
            strprp.MaxOpenLots     = Data.Strategy.MaxOpenLots;
            strprp.EntryLots       = Data.Strategy.EntryLots;
            strprp.AddingLots      = Data.Strategy.AddingLots;
            strprp.ReducingLots    = Data.Strategy.ReducingLots;
            strprp.UsePermanentSL  = Data.Strategy.UsePermanentSL;
            strprp.PermanentSLType = Data.Strategy.PermanentSLType;
            strprp.PermanentSL     = Data.Strategy.PermanentSL;
            strprp.UsePermanentTP  = Data.Strategy.UsePermanentTP;
            strprp.PermanentTPType = Data.Strategy.PermanentTPType;
            strprp.PermanentTP     = Data.Strategy.PermanentTP;
            strprp.UseBreakEven    = Data.Strategy.UseBreakEven;
            strprp.BreakEven       = Data.Strategy.BreakEven;
            strprp.SetParams();
            strprp.ShowDialog();

            if (strprp.DialogResult == DialogResult.OK)
            {
                OnStrategyChange();

                Data.StackStrategy.Push(Data.Strategy.Clone());

                Data.Strategy.SameSignalAction = strprp.SameDirAverg;
                Data.Strategy.OppSignalAction  = strprp.OppDirAverg;
                Data.Strategy.UseAccountPercentEntry = strprp.UseAccountPercentEntry;
                Data.Strategy.MaxOpenLots      = strprp.MaxOpenLots;
                Data.Strategy.EntryLots        = strprp.EntryLots;
                Data.Strategy.AddingLots       = strprp.AddingLots;
                Data.Strategy.ReducingLots     = strprp.ReducingLots;
                Data.Strategy.UsePermanentSL   = strprp.UsePermanentSL;
                Data.Strategy.PermanentSLType  = strprp.PermanentSLType;
                Data.Strategy.PermanentSL      = strprp.PermanentSL;
                Data.Strategy.UsePermanentTP   = strprp.UsePermanentTP;
                Data.Strategy.PermanentTPType  = strprp.PermanentTPType;
                Data.Strategy.PermanentTP      = strprp.PermanentTP;
                Data.Strategy.UseBreakEven     = strprp.UseBreakEven;
                Data.Strategy.BreakEven        = strprp.BreakEven;

                RebuildStrategyLayout();
                SetSrategyOverview();

                Data.IsStrategyChanged = true;

                CalculateStrategy(false);
            }

            return;
        }