Esempio n. 1
0
// ---------------------------------------------------------- //

        /// <summary>
        ///     Edits the Strategy Properties Slot
        /// </summary>
        private void EditStrategyProperties()
        {
            var strprp = new StrategyProperties
            {
                SameDirAverg           = Data.Strategy.SameSignalAction,
                OppDirAverg            = Data.Strategy.OppSignalAction,
                UseAccountPercentEntry = Data.Strategy.UseAccountPercentEntry,
                MaxOpenLots            = Data.Strategy.MaxOpenLots,
                EntryLots            = Data.Strategy.EntryLots,
                AddingLots           = Data.Strategy.AddingLots,
                ReducingLots         = Data.Strategy.ReducingLots,
                UsePermanentSL       = Data.Strategy.UsePermanentSL,
                PermanentSLType      = Data.Strategy.PermanentSLType,
                PermanentSL          = Data.Strategy.PermanentSL,
                UsePermanentTP       = Data.Strategy.UsePermanentTP,
                PermanentTPType      = Data.Strategy.PermanentTPType,
                PermanentTP          = Data.Strategy.PermanentTP,
                UseBreakEven         = Data.Strategy.UseBreakEven,
                BreakEven            = Data.Strategy.BreakEven,
                UseMartingale        = Data.Strategy.UseMartingale,
                MartingaleMultiplier = Data.Strategy.MartingaleMultiplier
            };

            strprp.SetParams();
            strprp.ShowDialog();

            if (strprp.DialogResult != DialogResult.OK)
            {
                return;
            }
            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;
            Data.Strategy.UseMartingale        = strprp.UseMartingale;
            Data.Strategy.MartingaleMultiplier = strprp.MartingaleMultiplier;

            RebuildStrategyLayout();
            SetSrategyOverview();

            Data.IsStrategyChanged = true;

            CalculateStrategy(false);
        }
// ---------------------------------------------------------- //

        /// <summary>
        ///     Edits the Strategy Properties Slot
        /// </summary>
        private void EditStrategyProperties()
        {
            Data.StackStrategy.Push(Data.Strategy.Clone());

            var strategyProperties = new StrategyProperties();
            strategyProperties.ShowDialog();

            if (strategyProperties.DialogResult == DialogResult.OK)
            {
                StatsBuffer.UpdateStatsBuffer();

                Text = Path.GetFileNameWithoutExtension(Data.StrategyName) + "* - " + Data.ProgramName;
                Data.IsStrategyChanged = true;
                RebuildStrategyLayout();
                BalanceChart.SetChartData();
                BalanceChart.InitChart();
                BalanceChart.Invalidate();
                HistogramChart.SetChartData();
                HistogramChart.InitChart();
                HistogramChart.Invalidate();
                SetupJournal();
                InfoPanelAccountStatistics.Update(Backtester.AccountStatsParam, Backtester.AccountStatsValue,
                                                  Backtester.AccountStatsFlags, Language.T("Account Statistics"));
            }
            else
            {
                UndoStrategy();
            }
        }
Esempio n. 3
0
        // ---------------------------------------------------------- //
        /// <summary>
        ///     Edits the Strategy Properties Slot
        /// </summary>
        private void EditStrategyProperties()
        {
            var strprp = new StrategyProperties
                {
                    SameDirAverg = Data.Strategy.SameSignalAction,
                    OppDirAverg = Data.Strategy.OppSignalAction,
                    UseAccountPercentEntry = Data.Strategy.UseAccountPercentEntry,
                    MaxOpenLots = Data.Strategy.MaxOpenLots,
                    EntryLots = Data.Strategy.EntryLots,
                    AddingLots = Data.Strategy.AddingLots,
                    ReducingLots = Data.Strategy.ReducingLots,
                    UsePermanentSL = Data.Strategy.UsePermanentSL,
                    PermanentSLType = Data.Strategy.PermanentSLType,
                    PermanentSL = Data.Strategy.PermanentSL,
                    UsePermanentTP = Data.Strategy.UsePermanentTP,
                    PermanentTPType = Data.Strategy.PermanentTPType,
                    PermanentTP = Data.Strategy.PermanentTP,
                    UseBreakEven = Data.Strategy.UseBreakEven,
                    BreakEven = Data.Strategy.BreakEven,
                    UseMartingale = Data.Strategy.UseMartingale,
                    MartingaleMultiplier = Data.Strategy.MartingaleMultiplier
                };
            strprp.SetParams();
            strprp.ShowDialog();

            if (strprp.DialogResult != DialogResult.OK) return;
            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;
            Data.Strategy.UseMartingale = strprp.UseMartingale;
            Data.Strategy.MartingaleMultiplier = strprp.MartingaleMultiplier;

            RebuildStrategyLayout();
            SetSrategyOverview();

            Data.IsStrategyChanged = true;

            CalculateStrategy(false);
        }