当前位置: 首页>>代码示例>>C#>>正文


C# NumericUpDown.EndInit方法代码示例

本文整理汇总了C#中System.Windows.Forms.NumericUpDown.EndInit方法的典型用法代码示例。如果您正苦于以下问题:C# NumericUpDown.EndInit方法的具体用法?C# NumericUpDown.EndInit怎么用?C# NumericUpDown.EndInit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.NumericUpDown的用法示例。


在下文中一共展示了NumericUpDown.EndInit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Maximum

		public void Maximum ()
		{
			Form f = new Form ();
			NumericUpDown nud = new NumericUpDown ();
			nud.BeginInit ();
			nud.Value = 1000;
			nud.Minimum = 2;
			nud.Maximum = 4;
			nud.EndInit ();
			f.Controls.Add (nud);
			f.Show ();

			Assert.AreEqual (4, nud.Value, "#A1");
			nud.Maximum = 3;
			Assert.AreEqual (3, nud.Value, "#A2");
			f.Dispose ();
		}
开发者ID:stabbylambda,项目名称:mono,代码行数:17,代码来源:NumericUpDownTest.cs

示例2: SetPanelLimitations

        /// <summary>
        /// Sets controls in panel Limitations
        /// </summary>
        void SetPanelLimitations()
        {
            chbAmbiguousBars = new CheckBox();
            chbAmbiguousBars.Parent    = pnlLimitations;
            chbAmbiguousBars.ForeColor = colorText;
            chbAmbiguousBars.BackColor = Color.Transparent;
            chbAmbiguousBars.Text      = Language.T("Maximum number of ambiguous bars");
            chbAmbiguousBars.Checked   = true;
            chbAmbiguousBars.AutoSize  = true;

            nudAmbiguousBars = new NumericUpDown();
            nudAmbiguousBars.Parent    = pnlLimitations;
            nudAmbiguousBars.TextAlign = HorizontalAlignment.Center;
            nudAmbiguousBars.BeginInit();
            nudAmbiguousBars.Minimum   = 0;
            nudAmbiguousBars.Maximum   = 100;
            nudAmbiguousBars.Increment = 1;
            nudAmbiguousBars.Value     = 10;
            nudAmbiguousBars.EndInit();

            chbMaxDrawdown = new CheckBox();
            chbMaxDrawdown.Parent    = pnlLimitations;
            chbMaxDrawdown.ForeColor = colorText;
            chbMaxDrawdown.BackColor = Color.Transparent;
            chbMaxDrawdown.Text      = Language.T("Maximum equity drawdown") + " [" + (Configs.AccountInMoney ? Configs.AccountCurrency + "]" : Language.T("pips") + "]");
            chbMaxDrawdown.Checked   = false;
            chbMaxDrawdown.AutoSize  = true;

            nudMaxDrawdown = new NumericUpDown();
            nudMaxDrawdown.Parent    = pnlLimitations;
            nudMaxDrawdown.TextAlign = HorizontalAlignment.Center;
            nudMaxDrawdown.BeginInit();
            nudMaxDrawdown.Minimum   = 0;
            nudMaxDrawdown.Maximum   = Configs.InitialAccount;
            nudMaxDrawdown.Increment = 10;
            nudMaxDrawdown.Value     = Configs.InitialAccount / 4;
            nudMaxDrawdown.EndInit();

            chbEquityPercent = new CheckBox();
            chbEquityPercent.Parent    = pnlLimitations;
            chbEquityPercent.ForeColor = colorText;
            chbEquityPercent.BackColor = Color.Transparent;
            chbEquityPercent.Text      = Language.T("Maximum equity drawdown") + " [% " + Configs.AccountCurrency + "]";
            chbEquityPercent.Checked   = true;
            chbEquityPercent.AutoSize  = true;

            nudEquityPercent = new NumericUpDown();
            nudEquityPercent.Parent    = pnlLimitations;
            nudEquityPercent.TextAlign = HorizontalAlignment.Center;
            nudEquityPercent.BeginInit();
            nudEquityPercent.Minimum   = 1;
            nudEquityPercent.Maximum   = 100;
            nudEquityPercent.Increment = 1;
            nudEquityPercent.Value     = 25;
            nudEquityPercent.EndInit();

            chbMinTrades = new CheckBox();
            chbMinTrades.Parent    = pnlLimitations;
            chbMinTrades.ForeColor = colorText;
            chbMinTrades.BackColor = Color.Transparent;
            chbMinTrades.Text      = Language.T("Minimum number of trades");
            chbMinTrades.Checked   = true;
            chbMinTrades.AutoSize  = true;

            nudMinTrades = new NumericUpDown();
            nudMinTrades.Parent    = pnlLimitations;
            nudMinTrades.TextAlign = HorizontalAlignment.Center;
            nudMinTrades.BeginInit();
            nudMinTrades.Minimum   = 10;
            nudMinTrades.Maximum   = 1000;
            nudMinTrades.Increment = 10;
            nudMinTrades.Value     = 100;
            nudMinTrades.EndInit();

            chbMaxTrades = new CheckBox();
            chbMaxTrades.Parent    = pnlLimitations;
            chbMaxTrades.ForeColor = colorText;
            chbMaxTrades.BackColor = Color.Transparent;
            chbMaxTrades.Text      = Language.T("Maximum number of trades");
            chbMaxTrades.Checked   = false;
            chbMaxTrades.AutoSize  = true;

            nudMaxTrades = new NumericUpDown();
            nudMaxTrades.Parent    = pnlLimitations;
            nudMaxTrades.TextAlign = HorizontalAlignment.Center;
            nudMaxTrades.BeginInit();
            nudMaxTrades.Minimum   = 10;
            nudMaxTrades.Maximum   = 10000;
            nudMaxTrades.Increment = 10;
            nudMaxTrades.Value     = 1000;
            nudMaxTrades.EndInit();

            chbWinLossRatio = new CheckBox();
            chbWinLossRatio.Parent    = pnlLimitations;
            chbWinLossRatio.ForeColor = colorText;
            chbWinLossRatio.BackColor = Color.Transparent;
            chbWinLossRatio.Text      = Language.T("Minimum win / loss trades ratio");
//.........这里部分代码省略.........
开发者ID:nuggett11,项目名称:Forex-Strategy-Builder,代码行数:101,代码来源:Generator+-+GUI.cs

示例3: Optimizer


//.........这里部分代码省略.........

            // pnlParamsBase
            pnlParamsBase.Parent    = this;
            pnlParamsBase.BackColor = LayoutColors.ColorControlBack;
            pnlParamsBase.Paint    += new PaintEventHandler(PnlParamsBase_Paint);

            // pnlCaptions
            pnlCaptions.Parent    = pnlParamsBase;
            pnlCaptions.Dock      = DockStyle.Top;
            pnlCaptions.BackColor = LayoutColors.ColorCaptionBack;
            pnlCaptions.ForeColor = LayoutColors.ColorCaptionText;
            pnlCaptions.Paint    += new PaintEventHandler(PnlCaptions_Paint);

            // pnlParamsBase2
            pnlParamsBase2.Parent    = pnlParamsBase;
            pnlParamsBase2.BackColor = LayoutColors.ColorControlBack;
            pnlParamsBase2.Resize   += new EventHandler(PnlParamsBase2_Resize);

            // VScrollBar
            scrollBar.Parent        = pnlParamsBase2;
            scrollBar.Dock          = DockStyle.Right;
            scrollBar.TabStop       = true;
            scrollBar.ValueChanged += new EventHandler(ScrollBar_ValueChanged);
            scrollBar.MouseWheel   += new MouseEventHandler(ScrollBar_MouseWheel);

            // pnlParams
            pnlParams.Parent    = pnlParamsBase2;
            pnlParams.BackColor = LayoutColors.ColorControlBack;

            // Panel Limitations
            pnlLimitations.Parent  = this;
            pnlLimitations.Visible = false;

            // smallBalanceChart
            smallBalanceChart.Parent    = this;
            smallBalanceChart.BackColor = LayoutColors.ColorControlBack;

            // ProgressBar
            progressBar.Parent  = this;
            progressBar.Minimum = 1;
            progressBar.Maximum = 100;
            progressBar.Step    = 1;

            //Button Optimize
            btnOptimize.Parent   = this;
            btnOptimize.Name     = "btnOptimize";
            btnOptimize.Text     = Language.T("Optimize");
            btnOptimize.TabIndex = 0;
            btnOptimize.Click   += new EventHandler(BtnOptimize_Click);
            btnOptimize.UseVisualStyleBackColor = true;

            //Button Accept
            btnAccept.Parent       = this;
            btnAccept.Name         = "btnAccept";
            btnAccept.Text         = Language.T("Accept");
            btnAccept.TabIndex     = 1;
            btnAccept.Enabled      = false;
            btnAccept.DialogResult = DialogResult.OK;
            btnAccept.UseVisualStyleBackColor = true;

            //Button Cancel
            btnCancel.Parent       = this;
            btnCancel.Text         = Language.T("Cancel");
            btnCancel.TabIndex     = 2;
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.UseVisualStyleBackColor = true;

            chbOutOfSample = new CheckBox();
            chbOutOfSample.Parent    = this;
            chbOutOfSample.ForeColor = colorText;
            chbOutOfSample.BackColor = Color.Transparent;
            chbOutOfSample.Text      = Language.T("OOS");
            chbOutOfSample.Checked   = false;
            chbOutOfSample.AutoSize  = true;
            chbOutOfSample.CheckedChanged += new EventHandler(ChbOutOfSample_CheckedChanged);

            nudOutOfSample = new NumericUpDown();
            nudOutOfSample.Parent    = this;
            nudOutOfSample.TextAlign = HorizontalAlignment.Center;
            nudOutOfSample.BeginInit();
            nudOutOfSample.Minimum   = 10;
            nudOutOfSample.Maximum   = 60;
            nudOutOfSample.Increment = 1;
            nudOutOfSample.Value     = 30;
            nudOutOfSample.EndInit();
            nudOutOfSample.ValueChanged += new EventHandler(NudOutOfSample_ValueChanged);

            // BackGroundWorker
            bgWorker = new BackgroundWorker();
            bgWorker.WorkerReportsProgress      = true;
            bgWorker.WorkerSupportsCancellation = true;
            bgWorker.DoWork             += new DoWorkEventHandler(BgWorker_DoWork);
            bgWorker.ProgressChanged    += new ProgressChangedEventHandler(BgWorker_ProgressChanged);
            bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BgWorker_RunWorkerCompleted);

            isOptimizing = false;
            SetPanelLimitations();

            return;
        }
开发者ID:nuggett11,项目名称:Forex-Strategy-Builder,代码行数:101,代码来源:Optimizer-old.cs

示例4: JForexImport

        /// <summary>
        /// Constructor
        /// </summary>
        public JForexImport()
        {
            LblIntro = new Label();
            TxbDataDirectory = new TextBox();
            BtnBrowse = new Button();
            PnlSettings = new FancyPanel();
            PnlInfoBase = new FancyPanel(Language.T("Imported Files"));
            TbxInfo = new TextBox();
            BtnHelp = new Button();
            BtnClose = new Button();
            BtnImport = new Button();
            ProgressBar = new ProgressBar();

            LblMarketClose = new Label();
            LblMarketOpen = new Label();
            NUDMarketClose = new NumericUpDown();
            NUDMarketOpen = new NumericUpDown();

            _colorText = LayoutColors.ColorControlText;

            MaximizeBox = false;
            MinimizeBox = false;
            ShowInTaskbar = false;
            Icon = Data.Icon;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton = BtnImport;
            CancelButton = BtnClose;
            Text = Language.T("JForex Import");

            // Label Intro
            LblIntro.Parent = PnlSettings;
            LblIntro.ForeColor = _colorText;
            LblIntro.BackColor = Color.Transparent;
            LblIntro.AutoSize = true;
            LblIntro.Text = Language.T("Directory containing JForex data files:");

            // Data Directory
            TxbDataDirectory.Parent = PnlSettings;
            TxbDataDirectory.BackColor = LayoutColors.ColorControlBack;
            TxbDataDirectory.ForeColor = _colorText;
            TxbDataDirectory.Text = Configs.JForexDataPath;

            // Button Browse
            BtnBrowse.Parent = PnlSettings;
            BtnBrowse.Name = "Browse";
            BtnBrowse.Text = Language.T("Browse");
            BtnBrowse.Click += BtnBrowseClick;
            BtnBrowse.UseVisualStyleBackColor = true;

            // Label Market Close
            LblMarketClose.Parent = PnlSettings;
            LblMarketClose.ForeColor = _colorText;
            LblMarketClose.BackColor = Color.Transparent;
            LblMarketClose.AutoSize = true;
            LblMarketClose.Text = Language.T("Market closing hour on Friday:");

            // Label Market Open
            LblMarketOpen.Parent = PnlSettings;
            LblMarketOpen.ForeColor = _colorText;
            LblMarketOpen.BackColor = Color.Transparent;
            LblMarketOpen.AutoSize = true;
            LblMarketOpen.Text = Language.T("Market opening hour on Sunday:");

            // NUDMarketClose
            NUDMarketClose.BeginInit();
            NUDMarketClose.Parent = PnlSettings;
            NUDMarketClose.TextAlign = HorizontalAlignment.Center;
            NUDMarketClose.Minimum = 0;
            NUDMarketClose.Maximum = 24;
            NUDMarketClose.Increment = 1;
            NUDMarketClose.Value = Configs.MarketClosingHour;
            NUDMarketClose.EndInit();

            // NUDMarketOpen
            NUDMarketOpen.BeginInit();
            NUDMarketOpen.Parent = PnlSettings;
            NUDMarketOpen.TextAlign = HorizontalAlignment.Center;
            NUDMarketOpen.Minimum = 0;
            NUDMarketOpen.Maximum = 24;
            NUDMarketOpen.Increment = 1;
            NUDMarketOpen.Value = Configs.MarketOpeningHour;
            NUDMarketOpen.EndInit();

            // pnlSettings
            PnlSettings.Parent = this;

            // PnlInfoBase
            PnlInfoBase.Parent = this;
            PnlInfoBase.Padding = new Padding(4, (int) PnlInfoBase.CaptionHeight, 2, 2);

            // TbxInfo
            TbxInfo.Parent = PnlInfoBase;
            TbxInfo.BorderStyle = BorderStyle.None;
            TbxInfo.Dock = DockStyle.Fill;
            TbxInfo.BackColor = LayoutColors.ColorControlBack;
            TbxInfo.ForeColor = LayoutColors.ColorControlText;
            TbxInfo.Multiline = true;
//.........这里部分代码省略.........
开发者ID:MichalGrzegorzak,项目名称:Forex-Strategy-Builder,代码行数:101,代码来源:JForexImport.cs

示例5: SetPanelSettings

        /// <summary>
        ///     Sets controls in panel Settings
        /// </summary>
        private void SetPanelSettings()
        {
            //chbWorkingMinutes
            chbWorkingMinutes.Parent = pnlSettings;
            chbWorkingMinutes.Text = Language.T("Working time limit in minutes");
            chbWorkingMinutes.AutoSize = true;
            chbWorkingMinutes.Checked = true;
            chbWorkingMinutes.ForeColor = LayoutColors.ColorControlText;
            chbWorkingMinutes.BackColor = Color.Transparent;

            // numUpDownWorkingTime
            nudWorkingMinutes.Parent = pnlSettings;
            nudWorkingMinutes.Value = 5;
            nudWorkingMinutes.Minimum = 1;
            nudWorkingMinutes.Maximum = 10000;
            nudWorkingMinutes.TextAlign = HorizontalAlignment.Center;

            // chbGenerateNewStrategy
            chbGenerateNewStrategy.Parent = pnlSettings;
            chbGenerateNewStrategy.Text = Language.T("Generate from zero profit at every start");
            chbGenerateNewStrategy.AutoSize = true;
            chbGenerateNewStrategy.Checked = true;
            chbGenerateNewStrategy.ForeColor = LayoutColors.ColorControlText;
            chbGenerateNewStrategy.BackColor = Color.Transparent;

            // chbPseudoOpt
            chbInitialOptimization.Parent = pnlSettings;
            chbInitialOptimization.Text = Language.T("Perform an initial optimization");
            chbInitialOptimization.AutoSize = true;
            chbInitialOptimization.Checked = true;
            chbInitialOptimization.ForeColor = LayoutColors.ColorControlText;
            chbInitialOptimization.BackColor = Color.Transparent;

            chbOutOfSample = new CheckBox
                {
                    Parent = pnlSettings,
                    ForeColor = colorText,
                    BackColor = Color.Transparent,
                    Text = Language.T("Out of sample testing, percent of OOS bars"),
                    Checked = false,
                    AutoSize = true
                };
            chbOutOfSample.CheckedChanged += ChbOutOfSampleCheckedChanged;

            nudOutOfSample = new NumericUpDown {Parent = pnlSettings, TextAlign = HorizontalAlignment.Center};
            nudOutOfSample.BeginInit();
            nudOutOfSample.Minimum = 10;
            nudOutOfSample.Maximum = 60;
            nudOutOfSample.Increment = 1;
            nudOutOfSample.Value = 30;
            nudOutOfSample.EndInit();
            nudOutOfSample.ValueChanged += NudOutOfSampleValueChanged;

            chbUseDefaultIndicatorValues = new CheckBox
                {
                    Parent = pnlSettings,
                    ForeColor = colorText,
                    BackColor = Color.Transparent,
                    Text = Language.T("Only use default numeric indicator values"),
                    Checked = false,
                    AutoSize = true
                };

            chbSaveStrategySlotStatus = new CheckBox
                {
                    Parent = pnlSettings,
                    ForeColor = colorText,
                    BackColor = Color.Transparent,
                    Text = Language.T("Save strategy slots Lock status"),
                    Checked = false,
                    AutoSize = true
                };

            chbHideFsb = new CheckBox
                {
                    Parent = pnlSettings,
                    ForeColor = colorText,
                    BackColor = Color.Transparent,
                    Text = Language.T("Hide FSB when Generator starts"),
                    Checked = true,
                    AutoSize = true,
                    Cursor = Cursors.Default
                };

            btnReset = new Button
                {
                    Parent = pnlSettings,
                    UseVisualStyleBackColor = true,
                    Text = Language.T("Reset all parameters and settings")
                };
            btnReset.Click += BtnResetClick;
        }
开发者ID:kevinegstorf,项目名称:Forex-Strategy-Builder,代码行数:95,代码来源:GeneratorGUI.cs

示例6: StrategyProperties


//.........这里部分代码省略.........
            // ComboBox OppDirAction
            CbxOppDirAction.Parent = PnlAveraging;
            CbxOppDirAction.Name = "cbxOppDirAction";
            CbxOppDirAction.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxOppDirAction.Items.AddRange(new object[]
                                               {
                                                   Language.T("Nothing"), Language.T("Reduce"), Language.T("Close"),
                                                   Language.T("Reverse")
                                               });
            CbxOppDirAction.SelectedIndex = 0;
            _toolTip.SetToolTip(CbxOppDirAction,
                                Language.T("Nothing - cancels the additional orders.") + Environment.NewLine +
                                Language.T("Reduce - reduces or closes a position.") + Environment.NewLine +
                                Language.T("Close - closes the position.") + Environment.NewLine +
                                Language.T("Reverse - reverses the position."));

            // Label MaxOpen Lots
            LblMaxOpenLots.Parent = PnlAmounts;
            LblMaxOpenLots.ForeColor = LayoutColors.ColorControlText;
            LblMaxOpenLots.BackColor = Color.Transparent;
            LblMaxOpenLots.AutoSize = true;
            LblMaxOpenLots.Text = Language.T("Maximum number of open lots");

            // NumericUpDown MaxOpen Lots
            NUDMaxOpenLots.Parent = PnlAmounts;
            NUDMaxOpenLots.Name = "nudMaxOpenLots";
            NUDMaxOpenLots.BeginInit();
            NUDMaxOpenLots.Minimum = 0.01M;
            NUDMaxOpenLots.Maximum = 100;
            NUDMaxOpenLots.Increment = 0.01M;
            NUDMaxOpenLots.Value = (decimal) MaxOpenLots;
            NUDMaxOpenLots.DecimalPlaces = 2;
            NUDMaxOpenLots.TextAlign = HorizontalAlignment.Center;
            NUDMaxOpenLots.EndInit();

            // Radio Button Constant Units
            RbConstantUnits.Parent = PnlAmounts;
            RbConstantUnits.ForeColor = LayoutColors.ColorControlText;
            RbConstantUnits.BackColor = Color.Transparent;
            RbConstantUnits.Checked = !UseAccountPercentEntry;
            RbConstantUnits.AutoSize = true;
            RbConstantUnits.Name = "rbConstantUnits";
            RbConstantUnits.Text = Language.T("Trade a constant number of lots");

            // Radio Button Variable Units
            RbVariableUnits.Parent = PnlAmounts;
            RbVariableUnits.ForeColor = LayoutColors.ColorControlText;
            RbVariableUnits.BackColor = Color.Transparent;
            RbVariableUnits.Checked = UseAccountPercentEntry;
            RbVariableUnits.AutoSize = false;
            RbVariableUnits.Name = "rbVariableUnits";
            RbVariableUnits.Text = Language.T("Trade a variable number of lots depending on your current account equity. The percentage values show the part of the account equity used to cover the required margin.");

            // Label Entry Lots
            LblEntryLots.Parent = PnlAmounts;
            LblEntryLots.ForeColor = LayoutColors.ColorControlText;
            LblEntryLots.BackColor = Color.Transparent;
            LblEntryLots.AutoSize = true;
            LblEntryLots.Text = Language.T("Number of entry lots for a new position");

            // NumericUpDown Entry Lots
            NUDEntryLots.Parent = PnlAmounts;
            NUDEntryLots.Name = "nudEntryLots";
            NUDEntryLots.BeginInit();
            NUDEntryLots.Minimum = 0.01M;
            NUDEntryLots.Maximum = 100;
开发者ID:kalaytan,项目名称:Forex-Strategy-Trader,代码行数:67,代码来源:StrategyProperties.cs

示例7: Instrument_Editor


//.........这里部分代码省略.........

            // cbxPropCommission
            cbxPropCommission.Parent        = pnlProperties;
            cbxPropCommission.Name          = "cbxPropCommission";
            cbxPropCommission.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPropCommission.Items.AddRange(new string[] { Language.T("pips"), Language.T("percents"), Language.T("money") });
            cbxPropCommission.SelectedIndex = 0;
            cbxPropCommission.SelectedIndexChanged += new EventHandler(CbxPropCommission_SelectedIndexChanged);

            // cbxPropCommScope
            cbxPropCommScope.Parent        = pnlProperties;
            cbxPropCommScope.Name          = "cbxPropCommScope";
            cbxPropCommScope.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPropCommScope.Items.AddRange(new string[] { Language.T("per lot"), Language.T("per deal") });
            cbxPropCommScope.SelectedIndex = 0;

            // cbxPropCommTime
            cbxPropCommTime.Parent        = pnlProperties;
            cbxPropCommTime.Name          = "cbxPropCommTime";
            cbxPropCommTime.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPropCommTime.Items.AddRange(new string[] { Language.T("at opening"), Language.T("at open/close")});
            cbxPropCommTime.SelectedIndex = 0;

            // NumericUpDown Digits
            nudPropDigits.BeginInit();
            nudPropDigits.Parent    = pnlProperties;
            nudPropDigits.Name      = "nudPropDigits";
            nudPropDigits.Minimum   = 0;
            nudPropDigits.Maximum   = 5;
            nudPropDigits.Increment = 1;
            nudPropDigits.Value     = 4;
            nudPropDigits.TextAlign = HorizontalAlignment.Center;
            nudPropDigits.ValueChanged += new EventHandler(NudPropDigits_ValueChanged);
            nudPropDigits.EndInit();

            // nudPropLotSize
            nudPropLotSize.BeginInit();
            nudPropLotSize.Parent    = pnlProperties;
            nudPropLotSize.Name      = "nudPropLotSize";
            nudPropLotSize.Minimum   = 0;
            nudPropLotSize.Maximum   = 100000;
            nudPropLotSize.Increment = 1;
            nudPropLotSize.Value     = 10000;
            nudPropLotSize.TextAlign = HorizontalAlignment.Center;
            nudPropLotSize.EndInit();

            // nudPropSpread
            nudPropSpread.BeginInit();
            nudPropSpread.Parent        = pnlProperties;
            nudPropSpread.Name          = "nudPropSpread";
            nudPropSpread.TextAlign     = HorizontalAlignment.Center;
            nudPropSpread.Minimum       = 0;
            nudPropSpread.Maximum       = 500;
            nudPropSpread.Increment     = 0.01M;
            nudPropSpread.DecimalPlaces = 2;
            nudPropSpread.Value         = 4;
            nudPropSpread.EndInit();
            toolTip.SetToolTip(nudPropSpread, Language.T("Difference between Bid and Ask prices."));

            // NumericUpDown Swap Long
            nudPropSwapLong.BeginInit();
            nudPropSwapLong.Parent        = pnlProperties;
            nudPropSwapLong.Name          = "nudPropSwapLong";
            nudPropSwapLong.TextAlign     = HorizontalAlignment.Center;
            nudPropSwapLong.Minimum       = -500;
            nudPropSwapLong.Maximum       = 500;
开发者ID:nuggett11,项目名称:Forex-Strategy-Builder,代码行数:67,代码来源:Instrument+Editor.cs

示例8: InitializeComponent


//.........这里部分代码省略.........
			panel11.Name = "panel11";
			panel11.Size = new Size(0x5d, 0x11);
			panel11.TabIndex = 4;
			rBtnDagcOff.AutoSize = true;
			rBtnDagcOff.Location = new Point(0x2d, 0);
			rBtnDagcOff.Margin = new Padding(3, 0, 3, 0);
			rBtnDagcOff.Name = "rBtnDagcOff";
			rBtnDagcOff.Size = new Size(0x2d, 0x11);
			rBtnDagcOff.TabIndex = 1;
			rBtnDagcOff.Text = "OFF";
			rBtnDagcOff.UseVisualStyleBackColor = true;
			rBtnDagcOff.CheckedChanged += new EventHandler(rBtnDagc_CheckedChanged);
			rBtnDagcOn.AutoSize = true;
			rBtnDagcOn.Checked = true;
			rBtnDagcOn.Location = new Point(3, 0);
			rBtnDagcOn.Margin = new Padding(3, 0, 3, 0);
			rBtnDagcOn.Name = "rBtnDagcOn";
			rBtnDagcOn.Size = new Size(0x29, 0x11);
			rBtnDagcOn.TabIndex = 0;
			rBtnDagcOn.TabStop = true;
			rBtnDagcOn.Text = "ON";
			rBtnDagcOn.UseVisualStyleBackColor = true;
			rBtnDagcOn.CheckedChanged += new EventHandler(rBtnDagc_CheckedChanged);
			base.AutoScaleDimensions = new SizeF(6f, 13f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			base.Controls.Add(gBoxDagc);
			base.Controls.Add(gBoxLnaSensitivity);
			base.Controls.Add(gBoxAgc);
			base.Controls.Add(gBoxRssi);
			base.Controls.Add(gBoxAfcFei);
			base.Controls.Add(gBoxOok);
			base.Controls.Add(gBoxAfcBw);
			base.Controls.Add(gBoxRxBw);
			base.Controls.Add(gBoxLna);
			base.Name = "ReceiverViewControl";
			base.Size = new Size(0x31f, 0x1ed);
			((ISupportInitialize)errorProvider).EndInit();
			panel3.ResumeLayout(false);
			panel3.PerformLayout();
			panel4.ResumeLayout(false);
			panel4.PerformLayout();
			pnlSensitivityBoost.ResumeLayout(false);
			pnlSensitivityBoost.PerformLayout();
			gBoxLnaSensitivity.ResumeLayout(false);
			gBoxLnaSensitivity.PerformLayout();
			gBoxAgc.ResumeLayout(false);
			gBoxAgc.PerformLayout();
			panel2.ResumeLayout(false);
			panel2.PerformLayout();
			nudAgcStep5.EndInit();
			nudAgcSnrMargin.EndInit();
			nudAgcStep4.EndInit();
			nudAgcRefLevel.EndInit();
			nudAgcStep3.EndInit();
			nudAgcStep1.EndInit();
			nudAgcStep2.EndInit();
			gBoxRssi.ResumeLayout(false);
			gBoxRssi.PerformLayout();
			pnlRssiPhase.ResumeLayout(false);
			pnlRssiPhase.PerformLayout();
			panel7.ResumeLayout(false);
			panel7.PerformLayout();
			nudRssiThresh.EndInit();
			panel1.ResumeLayout(false);
			panel1.PerformLayout();
			nudTimeoutRxStart.EndInit();
			nudTimeoutRssiThresh.EndInit();
			gBoxAfcFei.ResumeLayout(false);
			gBoxAfcFei.PerformLayout();
			nudLowBetaAfcOffset.EndInit();
			pnlAfcLowBeta.ResumeLayout(false);
			pnlAfcLowBeta.PerformLayout();
			panel8.ResumeLayout(false);
			panel8.PerformLayout();
			panel9.ResumeLayout(false);
			panel9.PerformLayout();
			gBoxOok.ResumeLayout(false);
			gBoxOok.PerformLayout();
			nudOokPeakThreshStep.EndInit();
			nudOokFixedThresh.EndInit();
			gBoxAfcBw.ResumeLayout(false);
			gBoxAfcBw.PerformLayout();
			nudAfcDccFreq.EndInit();
			nudRxFilterBwAfc.EndInit();
			gBoxRxBw.ResumeLayout(false);
			gBoxRxBw.PerformLayout();
			nudDccFreq.EndInit();
			nudRxFilterBw.EndInit();
			gBoxLna.ResumeLayout(false);
			gBoxLna.PerformLayout();
			panel5.ResumeLayout(false);
			panel5.PerformLayout();
			panel6.ResumeLayout(false);
			panel6.PerformLayout();
			gBoxDagc.ResumeLayout(false);
			gBoxDagc.PerformLayout();
			panel11.ResumeLayout(false);
			panel11.PerformLayout();
			base.ResumeLayout(false);
		}
开发者ID:JamesH001,项目名称:SX1231,代码行数:101,代码来源:ReceiverViewControl.cs

示例9: InstrumentEditor


//.........这里部分代码省略.........
            // CbxPropCommission
            CbxPropCommission.Parent = PnlProperties;
            CbxPropCommission.Name = "CbxPropCommission";
            CbxPropCommission.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPropCommission.Items.AddRange(new object[]
                {Language.T("points"), Language.T("percent"), Language.T("money")});
            CbxPropCommission.SelectedIndex = 0;
            CbxPropCommission.SelectedIndexChanged += CbxPropCommissionSelectedIndexChanged;

            // CbxPropCommScope
            CbxPropCommScope.Parent = PnlProperties;
            CbxPropCommScope.Name = "CbxPropCommScope";
            CbxPropCommScope.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPropCommScope.Items.AddRange(new object[] {Language.T("per lot"), Language.T("per deal")});
            CbxPropCommScope.SelectedIndex = 0;

            // CbxPropCommTime
            CbxPropCommTime.Parent = PnlProperties;
            CbxPropCommTime.Name = "CbxPropCommTime";
            CbxPropCommTime.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPropCommTime.Items.AddRange(new object[] {Language.T("at opening"), Language.T("at open/close")});
            CbxPropCommTime.SelectedIndex = 0;

            // NumericUpDown Digits
            NudPropDigits.BeginInit();
            NudPropDigits.Parent = PnlProperties;
            NudPropDigits.Name = "NUDPropDigits";
            NudPropDigits.Minimum = 0;
            NudPropDigits.Maximum = 5;
            NudPropDigits.Increment = 1;
            NudPropDigits.Value = 4;
            NudPropDigits.TextAlign = HorizontalAlignment.Center;
            NudPropDigits.ValueChanged += NudPropDigitsValueChanged;
            NudPropDigits.EndInit();

            // NUDPropLotSize
            NudPropLotSize.BeginInit();
            NudPropLotSize.Parent = PnlProperties;
            NudPropLotSize.Name = "NUDPropLotSize";
            NudPropLotSize.Minimum = 0;
            NudPropLotSize.Maximum = 100000;
            NudPropLotSize.Increment = 1;
            NudPropLotSize.Value = 10000;
            NudPropLotSize.TextAlign = HorizontalAlignment.Center;
            NudPropLotSize.EndInit();

            // NUDPropSpread
            NudPropSpread.BeginInit();
            NudPropSpread.Parent = PnlProperties;
            NudPropSpread.Name = "NUDPropSpread";
            NudPropSpread.TextAlign = HorizontalAlignment.Center;
            NudPropSpread.Minimum = 0;
            NudPropSpread.Maximum = 500;
            NudPropSpread.Increment = 0.01M;
            NudPropSpread.DecimalPlaces = 2;
            NudPropSpread.Value = 4;
            NudPropSpread.EndInit();
            toolTip.SetToolTip(NudPropSpread, Language.T("Difference between Bid and Ask prices."));

            // NumericUpDown Swap Long
            NudPropSwapLong.BeginInit();
            NudPropSwapLong.Parent = PnlProperties;
            NudPropSwapLong.Name = "NUDPropSwapLong";
            NudPropSwapLong.TextAlign = HorizontalAlignment.Center;
            NudPropSwapLong.Minimum = -500;
            NudPropSwapLong.Maximum = 500;
开发者ID:kevinegstorf,项目名称:Forex-Strategy-Builder,代码行数:67,代码来源:InstrumentEditor.cs

示例10: Comparator

        /// <summary>
        ///     Initialize the form and controls
        /// </summary>
        public Comparator()
        {
            PnlOptions = new Panel();
            PnlChart = new Panel();
            ProgressBar = new ProgressBar();
            LblAverageBalance = new Label();
            NumRandom = new NumericUpDown();
            LblRandomCycles = new Label();
            BtnCalculate = new Button();
            BtnClose = new Button();

            Text = Language.T("Comparator");
            BackColor = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Icon = Data.Icon;
            MaximizeBox = false;
            MinimizeBox = false;
            ShowInTaskbar = false;
            FormClosing += ActionsFormClosing;

            isPaintChart = false;

            //Button Calculate
            BtnCalculate.Parent = this;
            BtnCalculate.Name = "btnCalculate";
            BtnCalculate.Text = Language.T("Calculate");
            BtnCalculate.Click += BtnCalculateClick;
            BtnCalculate.UseVisualStyleBackColor = true;

            //Button Close
            BtnClose.Parent = this;
            BtnClose.Name = "btnClose";
            BtnClose.Text = Language.T("Close");
            BtnClose.DialogResult = DialogResult.OK;
            BtnClose.UseVisualStyleBackColor = true;

            // ProgressBar
            ProgressBar.Parent = this;
            ProgressBar.Minimum = 1;
            ProgressBar.Maximum = 100;
            ProgressBar.Step = 1;

            PnlChart.Parent = this;
            PnlChart.ForeColor = LayoutColors.ColorControlText;
            PnlChart.Paint += PnlChartPaint;

            PnlOptions.Parent = this;
            PnlOptions.ForeColor = LayoutColors.ColorControlText;
            PnlOptions.Paint += PnlOptionsPaint;

            countMethods = Enum.GetValues(typeof (InterpolationMethod)).Length;
            AchboxMethods = new CheckBox[countMethods];
            for (int i = 0; i < countMethods; i++)
            {
                AchboxMethods[i] = new CheckBox
                    {
                        Parent = PnlOptions,
                        Text = Language.T(Enum.GetNames(typeof (InterpolationMethod))[i]),
                        Tag = Enum.GetValues(typeof (InterpolationMethod)).GetValue(i),
                        Checked = true,
                        BackColor = Color.Transparent,
                        AutoSize = true
                    };
                AchboxMethods[i].CheckedChanged += ComparatorCheckedChanged;
            }

            // Label Average Balance
            LblAverageBalance.Parent = PnlOptions;
            LblAverageBalance.AutoSize = true;
            LblAverageBalance.Text = Language.T("Average balance");
            LblAverageBalance.ForeColor = LayoutColors.ColorControlText;
            LblAverageBalance.BackColor = Color.Transparent;
            LblAverageBalance.TextAlign = ContentAlignment.MiddleLeft;

            // NumUpDown random cycles
            NumRandom.BeginInit();
            NumRandom.Parent = this;
            NumRandom.Value = 25;
            NumRandom.Minimum = 3;
            NumRandom.Maximum = 100;
            NumRandom.TextAlign = HorizontalAlignment.Center;
            NumRandom.EndInit();

            // Label Random Cycles
            LblRandomCycles.Parent = this;
            LblRandomCycles.AutoSize = true;
            LblRandomCycles.ForeColor = LayoutColors.ColorControlText;
            LblRandomCycles.BackColor = Color.Transparent;
            LblRandomCycles.Text = Language.T("Random iterations");
            LblRandomCycles.TextAlign = ContentAlignment.MiddleLeft;

            // Colors
            penOptimistic = new Pen(LayoutColors.ComparatorChartOptimisticLine);
            penPessimistic = new Pen(LayoutColors.ComparatorChartPessimisticLine);
            penShortest = new Pen(LayoutColors.ComparatorChartShortestLine);
            penNearest = new Pen(LayoutColors.ComparatorChartNearestLine);
            penRandom = new Pen(LayoutColors.ComparatorChartRandomLine);
//.........这里部分代码省略.........
开发者ID:jorgealvarado212,项目名称:Forex-Strategy-Builder,代码行数:101,代码来源:Comparator.cs

示例11: OverOptimization

        /// <summary>
        /// Public constructor.
        /// </summary>
        public OverOptimization(string caption)
            : base(caption)
        {
            lblIntro      = new Label();
            lblDeviation  = new Label();
            lblParams     = new Label();
            nudDeviation  = new NumericUpDown();
            nudParams     = new NumericUpDown();
            btnStart      = new Button();
            btnViewCharts = new Button();
            btnOpenFolder = new Button();
            btnOpenReport = new Button();

            Font font = this.Font;
            Color colorText = LayoutColors.ColorControlText;

            // Label Intro
            lblIntro.Parent    = this;
            lblIntro.ForeColor = colorText;
            lblIntro.BackColor = Color.Transparent;
            lblIntro.AutoSize  = false;
            lblIntro.Text      = Language.T("The over-optimization report shows how the stats results of back test are changing with changing of the numerical parameters of the strategy by given percent.");

            // Label Deviation
            lblDeviation.Parent    = this;
            lblDeviation.ForeColor = colorText;
            lblDeviation.BackColor = Color.Transparent;
            lblDeviation.AutoSize  = true;
            lblDeviation.Text      = Language.T("Parameters deviation % [recommended 20]");

            // Label Parameters
            lblParams.Parent    = this;
            lblParams.ForeColor = colorText;
            lblParams.BackColor = Color.Transparent;
            lblParams.AutoSize  = true;
            lblParams.Text      = Language.T("Parameters number [recommended 20]");

            // NumericUpDown Deviation
            nudDeviation.BeginInit();
            nudDeviation.Parent    = this;
            nudDeviation.Name      = "Deviation";
            nudDeviation.TextAlign = HorizontalAlignment.Center;
            nudDeviation.Minimum   = 1;
            nudDeviation.Maximum   = 100;
            nudDeviation.Value     = 20;
            nudDeviation.EndInit();

            // NumericUpDown Swap Long
            nudParams.BeginInit();
            nudParams.Parent    = this;
            nudParams.Name      = "Parameters";
            nudParams.TextAlign = HorizontalAlignment.Center;
            nudParams.Minimum   = 1;
            nudParams.Maximum   = 100;
            nudParams.Value     = 20;
            nudParams.EndInit();

            // Button View Charts
            btnViewCharts.Parent     = this;
            btnViewCharts.Name       = "btnViewCharts";
            btnViewCharts.Text       = Language.T("View Charts");
            btnViewCharts.ImageAlign = ContentAlignment.MiddleLeft;
            btnViewCharts.Image      = Properties.Resources.overoptimization_chart;
            btnViewCharts.Enabled    = false;
            btnViewCharts.Click     += new EventHandler(ViewCharts_Click);
            btnViewCharts.UseVisualStyleBackColor = true;

            // Button Open report folder
            btnOpenFolder.Parent     = this;
            btnOpenFolder.Name       = "btnOpenFolder";
            btnOpenFolder.Text       = Language.T("Open Folder");
            btnOpenFolder.ImageAlign = ContentAlignment.MiddleLeft;
            btnOpenFolder.Image      = Properties.Resources.folder_open;
            btnOpenFolder.Enabled    = false;
            btnOpenFolder.Click     += new EventHandler(OpenFolder_Click);
            btnOpenFolder.UseVisualStyleBackColor = true;

            // Button Open Report
            btnOpenReport.Parent     = this;
            btnOpenReport.Name       = "btnOpenReport";
            btnOpenReport.Text       = Language.T("Open Report");
            btnOpenReport.ImageAlign = ContentAlignment.MiddleLeft;
            btnOpenReport.Image      = Properties.Resources.export;
            btnOpenReport.Enabled    = false;
            btnOpenReport.Click     += new EventHandler(OpenReport_Click);
            btnOpenReport.UseVisualStyleBackColor = true;

            // Button Run
            btnStart.Parent = this;
            btnStart.Text   = Language.T("Start");
            btnStart.Click += new EventHandler(BtnStart_Click);
            btnStart.UseVisualStyleBackColor = true;

            // ProgressBar
            progressBar = new ProgressBar();
            progressBar.Parent  = this;
            progressBar.Minimum = 1;
//.........这里部分代码省略.........
开发者ID:nuggett11,项目名称:Forex-Strategy-Builder,代码行数:101,代码来源:Over-optimization+GUI.cs

示例12: Bar_Explorer

        /// <summary>
        /// Initialize the form and controls
        /// </summary>
        public Bar_Explorer(int iBarNumber)
        {
            pnlChart = new Panel();
            pnlInfo  = new Panel();
            toolTip  = new ToolTip();

            barCurrent = iBarNumber < Data.FirstBar ? Data.FirstBar : iBarNumber;

            this.Text            = Language.T("Bar Explorer");
            this.BackColor       = LayoutColors.ColorFormBack;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Icon            = Data.Icon;
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;
            this.ShowInTaskbar   = false;

            fontInfo      = new Font(Font.FontFamily, 9);
            infoRowHeight = (int)Math.Max(fontInfo.Height, 18);

            barInfo = Language.T("Bar") + ": " + (barCurrent + 1).ToString() + " " +
                Data.Time[barCurrent].ToString(Data.DF) + " "  +
                Data.Time[barCurrent].ToString("HH:mm") + "; " +
                Language.T("Interpolation method")      + ": " +
                Backtester.InterpolationMethodToString();

            pnlChart.Parent = this;
            pnlChart.Paint += new PaintEventHandler(PnlChart_Paint);

            pnlInfo.Parent = this;
            pnlInfo.Paint += new PaintEventHandler(PnlInfo_Paint);

            btnNavigate = new Button[6];
            string [] btnNavigateText = new string [] {"< !", "<<", "<", ">", ">>", "! >"};
            string[]  btnNavigateTips = new string [] {
                Language.T("Previous ambiguous bar."),
                Language.T("Previous deal."),
                Language.T("Previous bar."),
                Language.T("Next bar."),
                Language.T("Next deal."),
                Language.T("Next ambiguous bar.")
            };

            for (int i = 0; i < 6; i++)
            {
                btnNavigate[i] = new Button();
                btnNavigate[i].Parent = this;
                btnNavigate[i].Text   = btnNavigateText[i];
                btnNavigate[i].Name   = btnNavigateText[i];
                btnNavigate[i].Click      += new EventHandler(BtnNavigate_Click);
                btnNavigate[i].MouseWheel += new MouseEventHandler(Bar_Explorer_MouseWheel);
                btnNavigate[i].KeyUp      += new KeyEventHandler(BtnNavigate_KeyUp);
                btnNavigate[i].UseVisualStyleBackColor = true;
                toolTip.SetToolTip(btnNavigate[i], btnNavigateTips[i]);
            }

            btnNavigate[0].Enabled = Backtester.AmbiguousBars  > 0;
            btnNavigate[1].Enabled = Backtester.PositionsTotal > 0;
            btnNavigate[4].Enabled = Backtester.PositionsTotal > 0;
            btnNavigate[5].Enabled = Backtester.AmbiguousBars  > 0;

            nudGo = new NumericUpDown();
            nudGo.Parent    = this;
            nudGo.TextAlign = HorizontalAlignment.Center;
            nudGo.BeginInit();
            nudGo.Minimum   = Data.FirstBar + 1;
            nudGo.Maximum   = Data.Bars;
            nudGo.Increment = 1;
            nudGo.Value     = barCurrent + 1;
            nudGo.KeyUp    += new KeyEventHandler(BtnNavigate_KeyUp);
            nudGo.EndInit();

            btnGo = new Button();
            btnGo.Parent = this;
            btnGo.Name   = "Go";
            btnGo.Text   = Language.T("Go");
            btnGo.UseVisualStyleBackColor = true;
            btnGo.Click      += new EventHandler(BtnNavigate_Click);
            btnGo.MouseWheel += new MouseEventHandler(Bar_Explorer_MouseWheel);
            btnGo.KeyUp      += new KeyEventHandler(BtnNavigate_KeyUp);
            toolTip.SetToolTip(btnGo, Language.T("Go to the chosen bar."));

            //Button Close
            btnClose = new Button();
            btnClose.Parent = this;
            btnClose.Text   = Language.T("Close");
            btnClose.DialogResult = DialogResult.Cancel;
            btnClose.UseVisualStyleBackColor = true;

            // Colors
            brushRed  = new SolidBrush(LayoutColors.ColorSignalRed);

            brushCaptionBack = new SolidBrush(LayoutColors.ColorCaptionBack);
            brushCaptionText = new SolidBrush(LayoutColors.ColorCaptionText);
            brushEvenRow     = new SolidBrush(LayoutColors.ColorEvenRowBack);
            brushBack        = new SolidBrush(LayoutColors.ColorControlBack);
            brushGridText    = new SolidBrush(LayoutColors.ColorChartFore);
            brushBarWhite    = new SolidBrush(LayoutColors.ColorBarWhite);
//.........这里部分代码省略.........
开发者ID:kamleshahre,项目名称:Forex-Strategy-Builder,代码行数:101,代码来源:Bar+Explorer.cs

示例13: SetPanelSettings

        /// <summary>
        /// Sets controls in panel Settings
        /// </summary>
        private void SetPanelSettings()
        {
            ChbOutOfSample = new CheckBox
                                 {
                                     Parent = PnlSettings,
                                     ForeColor = _colorText,
                                     BackColor = Color.Transparent,
                                     Text = Language.T("Out of sample testing, percent of OOS bars"),
                                     Checked = false,
                                     AutoSize = true
                                 };
            ChbOutOfSample.CheckedChanged += ChbOutOfSampleCheckedChanged;

            NUDOutOfSample = new NumericUpDown {Parent = PnlSettings, TextAlign = HorizontalAlignment.Center};
            NUDOutOfSample.BeginInit();
            NUDOutOfSample.Minimum = 10;
            NUDOutOfSample.Maximum = 60;
            NUDOutOfSample.Increment = 1;
            NUDOutOfSample.Value = 30;
            NUDOutOfSample.EndInit();
            NUDOutOfSample.ValueChanged += NudOutOfSampleValueChanged;

            ChbOptimizerWritesReport = new CheckBox
                                           {
                                               Parent = PnlSettings,
                                               ForeColor = _colorText,
                                               BackColor = Color.Transparent,
                                               Text = Language.T("Optimizer writes a report for each optimized strategy"),
                                               Checked = false,
                                               AutoSize = true
                                           };

            ChbHideFSB = new CheckBox
                             {
                                 Parent = PnlSettings,
                                 ForeColor = _colorText,
                                 BackColor = Color.Transparent,
                                 Text = Language.T("Hide FSB when Optimizer starts"),
                                 Checked = true,
                                 AutoSize = true
                             };

            BtnResetSettings = new Button
                                   {
                                       Parent = PnlSettings,
                                       UseVisualStyleBackColor = true,
                                       Text = Language.T("Reset all parameters and settings")
                                   };
            BtnResetSettings.Click += BtnResetClick;
        }
开发者ID:krogKrog,项目名称:Forex-Strategy-Builder,代码行数:53,代码来源:OptimizerGui.cs

示例14: SetPanelLimitations

        /// <summary>
        /// Sets controls in panel Limitations
        /// </summary>
        private void SetPanelLimitations()
        {
            ChbAmbiguousBars = new CheckBox
                                   {
                                       Parent = PnlLimitations,
                                       ForeColor = _colorText,
                                       BackColor = Color.Transparent,
                                       Text = Language.T("Maximum number of ambiguous bars"),
                                       Checked = false,
                                       AutoSize = true
                                   };

            NUDAmbiguousBars = new NumericUpDown {Parent = PnlLimitations, TextAlign = HorizontalAlignment.Center};
            NUDAmbiguousBars.BeginInit();
            NUDAmbiguousBars.Minimum = 0;
            NUDAmbiguousBars.Maximum = 100;
            NUDAmbiguousBars.Increment = 1;
            NUDAmbiguousBars.Value = 10;
            NUDAmbiguousBars.EndInit();

            ChbMaxDrawdown = new CheckBox
                                 {
                                     Parent = PnlLimitations,
                                     ForeColor = _colorText,
                                     BackColor = Color.Transparent,
                                     Checked = false,
                                     Text = Language.T("Maximum equity drawdown") + " [" +
                                            (Configs.AccountInMoney
                                                 ? Configs.AccountCurrency + "]"
                                                 : Language.T("pips") + "]"),
                                     AutoSize = true
                                 };

            NUDMaxDrawdown = new NumericUpDown {Parent = PnlLimitations, TextAlign = HorizontalAlignment.Center};
            NUDMaxDrawdown.BeginInit();
            NUDMaxDrawdown.Minimum = 0;
            NUDMaxDrawdown.Maximum = Configs.InitialAccount;
            NUDMaxDrawdown.Increment = 10;
            NUDMaxDrawdown.Value = Configs.InitialAccount/4M;
            NUDMaxDrawdown.EndInit();

            ChbEquityPercent = new CheckBox
                                   {
                                       Parent = PnlLimitations,
                                       ForeColor = _colorText,
                                       BackColor = Color.Transparent,
                                       Text = Language.T("Maximum equity drawdown") + " [% " + Configs.AccountCurrency +"]",
                                       Checked = false,
                                       AutoSize = true
                                   };

            NUDEquityPercent = new NumericUpDown {Parent = PnlLimitations, TextAlign = HorizontalAlignment.Center};
            NUDEquityPercent.BeginInit();
            NUDEquityPercent.Minimum = 1;
            NUDEquityPercent.Maximum = 100;
            NUDEquityPercent.Increment = 1;
            NUDEquityPercent.Value = 25;
            NUDEquityPercent.EndInit();

            ChbMinTrades = new CheckBox
                               {
                                   Parent = PnlLimitations,
                                   ForeColor = _colorText,
                                   BackColor = Color.Transparent,
                                   Text = Language.T("Minimum number of trades"),
                                   Checked = true,
                                   AutoSize = true
                               };

            NUDMinTrades = new NumericUpDown {Parent = PnlLimitations, TextAlign = HorizontalAlignment.Center};
            NUDMinTrades.BeginInit();
            NUDMinTrades.Minimum = 10;
            NUDMinTrades.Maximum = 1000;
            NUDMinTrades.Increment = 10;
            NUDMinTrades.Value = 100;
            NUDMinTrades.EndInit();

            ChbMaxTrades = new CheckBox
                               {
                                   Parent = PnlLimitations,
                                   ForeColor = _colorText,
                                   BackColor = Color.Transparent,
                                   Text = Language.T("Maximum number of trades"),
                                   Checked = false,
                                   AutoSize = true
                               };

            NUDMaxTrades = new NumericUpDown {Parent = PnlLimitations, TextAlign = HorizontalAlignment.Center};
            NUDMaxTrades.BeginInit();
            NUDMaxTrades.Minimum = 10;
            NUDMaxTrades.Maximum = 10000;
            NUDMaxTrades.Increment = 10;
            NUDMaxTrades.Value = 1000;
            NUDMaxTrades.EndInit();

            ChbWinLossRatio = new CheckBox
                                  {
//.........这里部分代码省略.........
开发者ID:krogKrog,项目名称:Forex-Strategy-Builder,代码行数:101,代码来源:OptimizerGui.cs

示例15: SetPanelSettings

        /// <summary>
        /// Sets controls in panel Settings
        /// </summary>
        void SetPanelSettings()
        {
            chbOutOfSample = new CheckBox();
            chbOutOfSample.Parent    = pnlSettings;
            chbOutOfSample.ForeColor = colorText;
            chbOutOfSample.BackColor = Color.Transparent;
            chbOutOfSample.Text      = Language.T("Out of sample testing, percent of OOS bars");
            chbOutOfSample.Checked   = false;
            chbOutOfSample.AutoSize  = true;
            chbOutOfSample.CheckedChanged += new EventHandler(ChbOutOfSample_CheckedChanged);

            nudOutOfSample = new NumericUpDown();
            nudOutOfSample.Parent    = pnlSettings;
            nudOutOfSample.TextAlign = HorizontalAlignment.Center;
            nudOutOfSample.BeginInit();
            nudOutOfSample.Minimum   = 10;
            nudOutOfSample.Maximum   = 60;
            nudOutOfSample.Increment = 1;
            nudOutOfSample.Value     = 30;
            nudOutOfSample.EndInit();
            nudOutOfSample.ValueChanged += new EventHandler(NudOutOfSample_ValueChanged);

            chbUseDefaultIndicatorValues = new CheckBox();
            chbUseDefaultIndicatorValues.Parent    = pnlSettings;
            chbUseDefaultIndicatorValues.ForeColor = colorText;
            chbUseDefaultIndicatorValues.BackColor = Color.Transparent;
            chbUseDefaultIndicatorValues.Text      = Language.T("Only use default numeric indicator values");
            chbUseDefaultIndicatorValues.Checked   = false;
            chbUseDefaultIndicatorValues.AutoSize  = true;

            chbHideFSB = new CheckBox();
            chbHideFSB.Parent    = pnlSettings;
            chbHideFSB.ForeColor = colorText;
            chbHideFSB.BackColor = Color.Transparent;
            chbHideFSB.Text      = Language.T("Hide FSB when Generator starts");
            chbHideFSB.Checked   = true;
            chbHideFSB.AutoSize  = true;
            chbHideFSB.Cursor    = Cursors.Default;

            btnReset = new Button();
            btnReset.Parent = pnlSettings;
            btnReset.UseVisualStyleBackColor = true;
            btnReset.Text = Language.T("Reset all parameters and settings");
            btnReset.Click += new EventHandler(BtnReset_Click);
        }
开发者ID:nuggett11,项目名称:Forex-Strategy-Builder,代码行数:48,代码来源:Generator+-+GUI.cs


注:本文中的System.Windows.Forms.NumericUpDown.EndInit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。