Exemplo n.º 1
0
        private void InitializeComponent()
        {
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(InputSpielMinute));

            nudGameMinute = new NumericUpDown();
            btnCancel     = new Button();
            btnOK         = new Button();
            nudGameMinute.BeginInit();
            SuspendLayout();
            nudGameMinute.AccessibleDescription = (string)null;
            nudGameMinute.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)nudGameMinute, "nudGameMinute");
            nudGameMinute.Font              = (Font)null;
            nudGameMinute.Maximum           = new decimal(new[] { 180, 0, 0, 0 });
            nudGameMinute.Name              = "nudGameMinute";
            btnCancel.AccessibleDescription = (string)null;
            btnCancel.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)btnCancel, "btnCancel");
            btnCancel.BackgroundImage         = (Image)null;
            btnCancel.Font                    = (Font)null;
            btnCancel.Name                    = "btnCancel";
            btnCancel.UseVisualStyleBackColor = true;
            btnCancel.Click                  += new EventHandler(btnCancel_Click);
            btnOK.AccessibleDescription       = (string)null;
            btnOK.AccessibleName              = (string)null;
            componentResourceManager.ApplyResources((object)btnOK, "btnOK");
            btnOK.BackgroundImage         = (Image)null;
            btnOK.Font                    = (Font)null;
            btnOK.Name                    = "btnOK";
            btnOK.UseVisualStyleBackColor = true;
            btnOK.Click                  += new EventHandler(btnOK_Click);
            AccessibleDescription         = (string)null;
            AccessibleName                = (string)null;
            componentResourceManager.ApplyResources((object)this, "$this");
            AutoScaleMode   = AutoScaleMode.Font;
            BackgroundImage = (Image)null;
            ControlBox      = false;
            Controls.Add((Control)btnOK);
            Controls.Add((Control)btnCancel);
            Controls.Add((Control)nudGameMinute);
            Font            = (Font)null;
            FormBorderStyle = FormBorderStyle.FixedSingle;
            Icon            = (Icon)null;
            MaximizeBox     = false;
            MinimizeBox     = false;
            Name            = nameof(InputSpielMinute);
            nudGameMinute.EndInit();
            ResumeLayout(false);
        }
Exemplo n.º 2
0
 private void InitializeComponent()
 {
     valueNUD     = new NumericUpDown();
     okButton     = new Button();
     cancelButton = new Button();
     valueNUD.BeginInit();
     SuspendLayout();
     valueNUD.Location = new Point(12, 12);
     int[] bits = new int[4];
     bits[0]           = 0xffff;
     valueNUD.Maximum  = new decimal(bits);
     valueNUD.Name     = "valueNUD";
     valueNUD.Size     = new Size(0x4b, 0x13);
     valueNUD.TabIndex = 0;
     okButton.Location = new Point(0x5d, 9);
     okButton.Name     = "okButton";
     okButton.Size     = new Size(0x4b, 0x17);
     okButton.TabIndex = 1;
     okButton.Text     = "OK";
     okButton.UseVisualStyleBackColor = true;
     okButton.Click                      += okButton_Click;
     cancelButton.DialogResult            = DialogResult.Cancel;
     cancelButton.Location                = new Point(0xae, 9);
     cancelButton.Name                    = "cancelButton";
     cancelButton.Size                    = new Size(0x4b, 0x17);
     cancelButton.TabIndex                = 2;
     cancelButton.Text                    = "Cancel";
     cancelButton.UseVisualStyleBackColor = true;
     cancelButton.Click                  += cancelButton_Click;
     AcceptButton        = okButton;
     AutoScaleDimensions = new SizeF(6f, 12f);
     AutoScaleMode       = AutoScaleMode.Font;
     CancelButton        = cancelButton;
     ClientSize          = new Size(0x103, 0x2b);
     Controls.Add(cancelButton);
     Controls.Add(okButton);
     Controls.Add(valueNUD);
     FormBorderStyle = FormBorderStyle.FixedSingle;
     MaximizeBox     = false;
     Name            = "ValueInputForm";
     StartPosition   = FormStartPosition.CenterParent;
     Text            = "Please Input...";
     Activated      += ValueInputForm_Activated;
     valueNUD.EndInit();
     ResumeLayout(false);
 }
Exemplo n.º 3
0
        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();
        }
 private void InitializeComponent()
 {
     btnCancel       = new Button();
     btnOK           = new Button();
     nudPlayerNumber = new NumericUpDown();
     nudPlayerNumber.BeginInit();
     SuspendLayout();
     btnCancel.Location = new Point(12, 49);
     btnCancel.Name     = "btnCancel";
     btnCancel.Size     = new Size(118, 32);
     btnCancel.TabIndex = 0;
     btnCancel.Text     = "Cancel";
     btnCancel.UseVisualStyleBackColor = true;
     btnCancel.Click += new EventHandler(btnCancel_Click);
     btnOK.Location   = new Point(136, 49);
     btnOK.Name       = "btnOK";
     btnOK.Size       = new Size(118, 32);
     btnOK.TabIndex   = 1;
     btnOK.Text       = "OK";
     btnOK.UseVisualStyleBackColor = true;
     btnOK.Click              += new EventHandler(btnOK_Click);
     nudPlayerNumber.Font      = new Font("Microsoft Sans Serif", 15.75f, FontStyle.Bold, GraphicsUnit.Point, (byte)0);
     nudPlayerNumber.Location  = new Point(71, 12);
     nudPlayerNumber.Name      = "nudPlayerNumber";
     nudPlayerNumber.Size      = new Size(120, 31);
     nudPlayerNumber.TabIndex  = 2;
     nudPlayerNumber.TextAlign = HorizontalAlignment.Center;
     AutoScaleDimensions       = new SizeF(6f, 13f);
     AutoScaleMode             = AutoScaleMode.Font;
     ClientSize = new Size(264, 90);
     ControlBox = false;
     Controls.Add((Control)nudPlayerNumber);
     Controls.Add((Control)btnOK);
     Controls.Add((Control)btnCancel);
     Name          = nameof(InputFormPlayerNumber);
     StartPosition = FormStartPosition.CenterParent;
     Text          = "PlayerNumber";
     nudPlayerNumber.EndInit();
     ResumeLayout(false);
 }
Exemplo n.º 5
0
        private void InitializeComponent()
        {
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(ScoreInput));

            nudScore = new NumericUpDown();
            nudScore.BeginInit();
            SuspendLayout();
            nudScore.AccessibleDescription = (string)null;
            nudScore.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)nudScore, "nudScore");
            nudScore.Font    = (Font)null;
            nudScore.Maximum = new Decimal(new int[4]
            {
                999,
                0,
                0,
                0
            });
            nudScore.Name         = "nudScore";
            AccessibleDescription = (string)null;
            AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)this, "$this");
            AutoScaleMode   = AutoScaleMode.Font;
            BackgroundImage = (Image)null;
            Controls.Add((Control)nudScore);
            Font            = (Font)null;
            FormBorderStyle = FormBorderStyle.FixedSingle;
            Icon            = (Icon)null;
            KeyPreview      = true;
            MaximizeBox     = false;
            MinimizeBox     = false;
            Name            = nameof(ScoreInput);
            KeyDown        += new KeyEventHandler(ScoreInput_KeyDown);
            nudScore.EndInit();
            ResumeLayout(false);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public ProfitCalculator()
        {
            PnlInput  = new FancyPanel(Language.T("Input Values"));
            PnlOutput = new FancyPanel(Language.T("Output Values"));

            AlblInputNames   = new Label[6];
            AlblOutputNames  = new Label[8];
            AlblOutputValues = new Label[8];

            LblLotSize    = new Label();
            CbxDirection  = new ComboBox();
            NUDLots       = new NumericUpDown();
            NUDEntryPrice = new NumericUpDown();
            NUDExitPrice  = new NumericUpDown();
            NUDDays       = new NumericUpDown();

            _colorText = LayoutColors.ColorControlText;

            MaximizeBox     = false;
            MinimizeBox     = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Text            = Language.T("Profit Calculator");

            // Input
            PnlInput.Parent = this;

            // Output
            PnlOutput.Parent = this;

            // Input Names
            var asInputNames = new[]
            {
                Data.InstrProperties.Symbol,
                Language.T("Direction"),
                Language.T("Number of lots"),
                Language.T("Entry price"),
                Language.T("Exit price"),
                Language.T("Days rollover")
            };

            int number = 0;

            foreach (string name in asInputNames)
            {
                AlblInputNames[number] = new Label
                {
                    Parent    = PnlInput,
                    ForeColor = _colorText,
                    BackColor = Color.Transparent,
                    AutoSize  = true,
                    Text      = name
                };
                number++;
            }

            // Label Lot size
            LblLotSize.Parent    = PnlInput;
            LblLotSize.ForeColor = _colorText;
            LblLotSize.BackColor = Color.Transparent;

            // ComboBox SameDirAction
            CbxDirection.Parent        = PnlInput;
            CbxDirection.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxDirection.Items.AddRange(new object[] { Language.T("Long"), Language.T("Short") });
            CbxDirection.SelectedIndex = 0;

            // Lots
            NUDLots.Parent = PnlInput;
            NUDLots.BeginInit();
            NUDLots.Minimum       = 0.01M;
            NUDLots.Maximum       = 100;
            NUDLots.Increment     = 0.01M;
            NUDLots.DecimalPlaces = 2;
            NUDLots.Value         = (decimal)Data.Strategy.EntryLots;
            NUDLots.EndInit();

            // NumericUpDown Entry Price
            NUDEntryPrice.Parent = PnlInput;

            // NumericUpDown Exit Price
            NUDExitPrice.Parent = PnlInput;

            // NumericUpDown Reducing Lots
            NUDDays.Parent = PnlInput;
            NUDDays.BeginInit();
            NUDDays.Minimum   = 0;
            NUDDays.Maximum   = 1000;
            NUDDays.Increment = 1;
            NUDDays.Value     = 1;
            NUDDays.EndInit();

            // Output Names
            var asOutputNames = new[]
            {
                Language.T("Required margin"),
                Language.T("Gross profit"),
                Language.T("Spread"),
                Language.T("Entry commission"),
                Language.T("Exit commission"),
                Language.T("Rollover"),
                Language.T("Slippage"),
                Language.T("Net profit")
            };

            number = 0;
            foreach (string name in asOutputNames)
            {
                AlblOutputNames[number] = new Label
                {
                    Parent    = PnlOutput,
                    ForeColor = _colorText,
                    BackColor = Color.Transparent,
                    AutoSize  = true,
                    Text      = name
                };

                AlblOutputValues[number] = new Label
                {
                    Parent    = PnlOutput,
                    ForeColor = _colorText,
                    BackColor = Color.Transparent,
                    AutoSize  = true
                };

                number++;
            }

            AlblOutputNames[number - 1].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            AlblOutputValues[number - 1].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);

            Timer = new Timer {
                Interval = 2000
            };
            Timer.Tick += TimerTick;
            Timer.Start();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Account_Settings()
        {
            pnlBase = new Fancy_Panel();

            lblAccountCurrency  = new Label();
            lblInitialAccount   = new Label();
            lblLeverage         = new Label();
            lblExchangeRate     = new Label();
            lblExchangeRateInfo = new Label();

            cbxAccountCurrency = new ComboBox();
            nudInitialAccount  = new NumericUpDown();
            cbxLeverage        = new ComboBox();
            nudExchangeRate    = new NumericUpDown();
            tbxExchangeRate    = new TextBox();

            btnDefault = new Button();
            btnCancel  = new Button();
            btnAccept  = new Button();

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

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = btnAccept;
            Text            = Language.T("Account Settings");

            // pnlBase
            pnlBase.Parent = this;

            // Label Account Currency
            lblAccountCurrency.Parent    = pnlBase;
            lblAccountCurrency.ForeColor = colorText;
            lblAccountCurrency.BackColor = Color.Transparent;
            lblAccountCurrency.Text      = Language.T("Account currency");
            lblAccountCurrency.AutoSize  = true;

            // Label Initial Account
            lblInitialAccount.Parent    = pnlBase;
            lblInitialAccount.ForeColor = colorText;
            lblInitialAccount.BackColor = Color.Transparent;
            lblInitialAccount.Text      = Language.T("Initial account");
            lblInitialAccount.AutoSize  = true;

            // Label Leverage
            lblLeverage.Parent    = pnlBase;
            lblLeverage.ForeColor = colorText;
            lblLeverage.BackColor = Color.Transparent;
            lblLeverage.Text      = Language.T("Leverage");
            lblLeverage.AutoSize  = true;

            // Label Exchange Rate
            lblExchangeRate.Parent    = pnlBase;
            lblExchangeRate.ForeColor = colorText;
            lblExchangeRate.BackColor = Color.Transparent;
            lblExchangeRate.Text      = Language.T("Account exchange rate");
            lblExchangeRate.AutoSize  = true;

            // Label Exchange Rate Info
            lblExchangeRateInfo.Parent    = pnlBase;
            lblExchangeRateInfo.ForeColor = colorText;
            lblExchangeRateInfo.BackColor = Color.Transparent;
            lblExchangeRateInfo.Text      =
                Language.T("Forex Strategy Builder uses the account exchange rate to calculate the trading statistics in your account currency.") + " " +
                Language.T("When your account currency does not take part in the trading couple the account exchange rate is a fixed figure.");

            // ComboBox Account Currency
            cbxAccountCurrency.Parent        = pnlBase;
            cbxAccountCurrency.Name          = "cbxAccountCurrency";
            cbxAccountCurrency.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxAccountCurrency.Items.AddRange(new string[] { "USD", "EUR" });
            cbxAccountCurrency.SelectedIndex = 0;

            // NumericUpDown Initial Account
            nudInitialAccount.Parent = pnlBase;
            nudInitialAccount.Name   = "nudInitialAccount";
            nudInitialAccount.BeginInit();
            nudInitialAccount.Minimum   = 100;
            nudInitialAccount.Maximum   = 100000;
            nudInitialAccount.Increment = 1000;
            nudInitialAccount.Value     = initialAccount;
            nudInitialAccount.EndInit();

            // ComboBox Leverage
            cbxLeverage.Parent        = pnlBase;
            cbxLeverage.Name          = "cbxLeverage";
            cbxLeverage.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxLeverage.Items.AddRange(new string[] { "1/1", "1/10", "1/20", "1/30", "1/50", "1/100", "1/200", "1/300", "1/400", "1/500" });
            cbxLeverage.SelectedIndex = 5;

            // tbxExchangeRate
            tbxExchangeRate.Parent    = pnlBase;
            tbxExchangeRate.BackColor = LayoutColors.ColorControlBack;
            tbxExchangeRate.ForeColor = colorText;
            tbxExchangeRate.ReadOnly  = true;
            tbxExchangeRate.Visible   = false;
            tbxExchangeRate.Text      = Language.T("Deal price");

            // NumericUpDown Exchange Rate
            nudExchangeRate.BeginInit();
            nudExchangeRate.Parent        = pnlBase;
            nudExchangeRate.Name          = "nudExchangeRate";
            nudExchangeRate.Minimum       = 0;
            nudExchangeRate.Maximum       = 100000;
            nudExchangeRate.Increment     = 0.0001M;
            nudExchangeRate.DecimalPlaces = 4;
            nudExchangeRate.Value         = 1;
            nudExchangeRate.EndInit();

            //Button Default
            btnDefault.Parent = this;
            btnDefault.Name   = "Default";
            btnDefault.Text   = Language.T("Default");
            btnDefault.Click += new EventHandler(BtnDefault_Click);
            btnDefault.UseVisualStyleBackColor = true;

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

            //Button Accept
            btnAccept.Parent                  = this;
            btnAccept.Name                    = "Accept";
            btnAccept.Text                    = Language.T("Accept");
            btnAccept.DialogResult            = DialogResult.OK;
            btnAccept.UseVisualStyleBackColor = true;
        }
Exemplo n.º 8
0
 private void InitializeComponent()
 {
     splitContainer1 = new SplitContainer();
     skillListBox    = new ListBox();
     groupBox1       = new GroupBox();
     x0B_NUD         = new NumericUpDown();
     label11         = new Label();
     label22         = new Label();
     x21_NUD         = new NumericUpDown();
     x1E_NUD         = new NumericUpDown();
     label25         = new Label();
     label23         = new Label();
     x20_NUD         = new NumericUpDown();
     x1F_NUD         = new NumericUpDown();
     label24         = new Label();
     x1D_NUD         = new NumericUpDown();
     x1A_NUD         = new NumericUpDown();
     x17_CoB         = new ComboBox();
     x1C_NUD         = new NumericUpDown();
     x19_NUD         = new NumericUpDown();
     x16_CoB         = new ComboBox();
     x1B_NUD         = new NumericUpDown();
     x18_NUD         = new NumericUpDown();
     x15_CoB         = new ComboBox();
     label21         = new Label();
     label20         = new Label();
     label19         = new Label();
     x14_CoB         = new ComboBox();
     label18         = new Label();
     x13_NUD         = new NumericUpDown();
     label17         = new Label();
     x12_NUD         = new NumericUpDown();
     label16         = new Label();
     x10_NUD         = new NumericUpDown();
     label15         = new Label();
     x0F_NUD         = new NumericUpDown();
     label14         = new Label();
     x0E_NUD         = new NumericUpDown();
     label13         = new Label();
     x0D_NUD         = new NumericUpDown();
     x0C_NUD         = new NumericUpDown();
     label12         = new Label();
     x0A_NUD         = new NumericUpDown();
     label10         = new Label();
     x08_CoB         = new ComboBox();
     label9          = new Label();
     x07_MAX_NUD     = new NumericUpDown();
     x07_MIN_NUD     = new NumericUpDown();
     label8          = new Label();
     x06_NUD         = new NumericUpDown();
     label7          = new Label();
     x05_NUD         = new NumericUpDown();
     label6          = new Label();
     x04_NUD         = new NumericUpDown();
     label5          = new Label();
     x03_NUD         = new NumericUpDown();
     label4          = new Label();
     x02_CoB         = new ComboBox();
     label3          = new Label();
     x01_CoB         = new ComboBox();
     label2          = new Label();
     x00_CoB         = new ComboBox();
     label1          = new Label();
     okButton        = new Button();
     cancelButton    = new Button();
     groupBox4       = new GroupBox();
     searchButton    = new Button();
     searchComboBox  = new ComboBox();
     searchTextBox   = new TextBox();
     splitContainer1.Panel1.SuspendLayout();
     splitContainer1.Panel2.SuspendLayout();
     splitContainer1.SuspendLayout();
     groupBox1.SuspendLayout();
     x0B_NUD.BeginInit();
     x21_NUD.BeginInit();
     x1E_NUD.BeginInit();
     x20_NUD.BeginInit();
     x1F_NUD.BeginInit();
     x1D_NUD.BeginInit();
     x1A_NUD.BeginInit();
     x1C_NUD.BeginInit();
     x19_NUD.BeginInit();
     x1B_NUD.BeginInit();
     x18_NUD.BeginInit();
     x13_NUD.BeginInit();
     x12_NUD.BeginInit();
     x10_NUD.BeginInit();
     x0F_NUD.BeginInit();
     x0E_NUD.BeginInit();
     x0D_NUD.BeginInit();
     x0C_NUD.BeginInit();
     x0A_NUD.BeginInit();
     x07_MAX_NUD.BeginInit();
     x07_MIN_NUD.BeginInit();
     x06_NUD.BeginInit();
     x05_NUD.BeginInit();
     x04_NUD.BeginInit();
     x03_NUD.BeginInit();
     groupBox4.SuspendLayout();
     SuspendLayout();
     splitContainer1.Dock     = DockStyle.Top;
     splitContainer1.Location = new Point(0, 0);
     splitContainer1.Name     = "splitContainer1";
     splitContainer1.Panel1.Controls.Add(groupBox4);
     splitContainer1.Panel1.Controls.Add(skillListBox);
     splitContainer1.Panel2.Controls.Add(groupBox1);
     splitContainer1.Panel2.Controls.Add(x1D_NUD);
     splitContainer1.Panel2.Controls.Add(x1A_NUD);
     splitContainer1.Panel2.Controls.Add(x17_CoB);
     splitContainer1.Panel2.Controls.Add(x1C_NUD);
     splitContainer1.Panel2.Controls.Add(x19_NUD);
     splitContainer1.Panel2.Controls.Add(x16_CoB);
     splitContainer1.Panel2.Controls.Add(x1B_NUD);
     splitContainer1.Panel2.Controls.Add(x18_NUD);
     splitContainer1.Panel2.Controls.Add(x15_CoB);
     splitContainer1.Panel2.Controls.Add(label21);
     splitContainer1.Panel2.Controls.Add(label20);
     splitContainer1.Panel2.Controls.Add(label19);
     splitContainer1.Panel2.Controls.Add(x14_CoB);
     splitContainer1.Panel2.Controls.Add(label18);
     splitContainer1.Panel2.Controls.Add(x13_NUD);
     splitContainer1.Panel2.Controls.Add(label17);
     splitContainer1.Panel2.Controls.Add(x12_NUD);
     splitContainer1.Panel2.Controls.Add(label16);
     splitContainer1.Panel2.Controls.Add(x10_NUD);
     splitContainer1.Panel2.Controls.Add(label15);
     splitContainer1.Panel2.Controls.Add(x0F_NUD);
     splitContainer1.Panel2.Controls.Add(label14);
     splitContainer1.Panel2.Controls.Add(x0E_NUD);
     splitContainer1.Panel2.Controls.Add(label13);
     splitContainer1.Panel2.Controls.Add(x0D_NUD);
     splitContainer1.Panel2.Controls.Add(x0C_NUD);
     splitContainer1.Panel2.Controls.Add(label12);
     splitContainer1.Panel2.Controls.Add(x0A_NUD);
     splitContainer1.Panel2.Controls.Add(label10);
     splitContainer1.Panel2.Controls.Add(x08_CoB);
     splitContainer1.Panel2.Controls.Add(label9);
     splitContainer1.Panel2.Controls.Add(x07_MAX_NUD);
     splitContainer1.Panel2.Controls.Add(x07_MIN_NUD);
     splitContainer1.Panel2.Controls.Add(label8);
     splitContainer1.Panel2.Controls.Add(x06_NUD);
     splitContainer1.Panel2.Controls.Add(label7);
     splitContainer1.Panel2.Controls.Add(x05_NUD);
     splitContainer1.Panel2.Controls.Add(label6);
     splitContainer1.Panel2.Controls.Add(x04_NUD);
     splitContainer1.Panel2.Controls.Add(label5);
     splitContainer1.Panel2.Controls.Add(x03_NUD);
     splitContainer1.Panel2.Controls.Add(label4);
     splitContainer1.Panel2.Controls.Add(x02_CoB);
     splitContainer1.Panel2.Controls.Add(label3);
     splitContainer1.Panel2.Controls.Add(x01_CoB);
     splitContainer1.Panel2.Controls.Add(label2);
     splitContainer1.Panel2.Controls.Add(x00_CoB);
     splitContainer1.Panel2.Controls.Add(label1);
     splitContainer1.Size             = new Size(0x224, 0x15f);
     splitContainer1.SplitterDistance = 0x85;
     splitContainer1.TabIndex         = 0;
     skillListBox.Dock = DockStyle.Top;
     skillListBox.FormattingEnabled = true;
     skillListBox.ItemHeight        = 12;
     skillListBox.Location          = new Point(0, 0);
     skillListBox.Name     = "skillListBox";
     skillListBox.Size     = new Size(0x85, 0x10c);
     skillListBox.TabIndex = 0;
     groupBox1.Controls.Add(x0B_NUD);
     groupBox1.Controls.Add(label11);
     groupBox1.Controls.Add(label22);
     groupBox1.Controls.Add(x21_NUD);
     groupBox1.Controls.Add(x1E_NUD);
     groupBox1.Controls.Add(label25);
     groupBox1.Controls.Add(label23);
     groupBox1.Controls.Add(x20_NUD);
     groupBox1.Controls.Add(x1F_NUD);
     groupBox1.Controls.Add(label24);
     groupBox1.Location = new Point(5, 0x11f);
     groupBox1.Name     = "groupBox1";
     groupBox1.Size     = new Size(0xf2, 0x38);
     groupBox1.TabIndex = 0x30;
     groupBox1.TabStop  = false;
     groupBox1.Text     = "Unknown Bytes";
     x0B_NUD.Location   = new Point(8, 30);
     int[] bits = new int[4];
     bits[0]          = 0xff;
     x0B_NUD.Maximum  = new decimal(bits);
     x0B_NUD.Name     = "x0B_NUD";
     x0B_NUD.Size     = new Size(40, 0x13);
     x0B_NUD.TabIndex = 1;
     label11.AutoSize = true;
     label11.Location = new Point(6, 15);
     label11.Name     = "label11";
     label11.Size     = new Size(0x19, 12);
     label11.TabIndex = 0;
     label11.Text     = "$0B";
     label22.AutoSize = true;
     label22.Location = new Point(0x34, 15);
     label22.Name     = "label22";
     label22.Size     = new Size(0x18, 12);
     label22.TabIndex = 2;
     label22.Text     = "$1E";
     x21_NUD.Location = new Point(0xc0, 30);
     int[] numArray2 = new int[4];
     numArray2[0]     = 0xff;
     x21_NUD.Maximum  = new decimal(numArray2);
     x21_NUD.Name     = "x21_NUD";
     x21_NUD.Size     = new Size(40, 0x13);
     x21_NUD.TabIndex = 9;
     x1E_NUD.Location = new Point(0x36, 30);
     int[] numArray3 = new int[4];
     numArray3[0]     = 0xff;
     x1E_NUD.Maximum  = new decimal(numArray3);
     x1E_NUD.Name     = "x1E_NUD";
     x1E_NUD.Size     = new Size(40, 0x13);
     x1E_NUD.TabIndex = 3;
     label25.AutoSize = true;
     label25.Location = new Point(190, 15);
     label25.Name     = "label25";
     label25.Size     = new Size(0x17, 12);
     label25.TabIndex = 8;
     label25.Text     = "$21";
     label23.AutoSize = true;
     label23.Location = new Point(0x62, 15);
     label23.Name     = "label23";
     label23.Size     = new Size(0x18, 12);
     label23.TabIndex = 4;
     label23.Text     = "$1F";
     x20_NUD.Location = new Point(0x92, 30);
     int[] numArray4 = new int[4];
     numArray4[0]     = 0xff;
     x20_NUD.Maximum  = new decimal(numArray4);
     x20_NUD.Name     = "x20_NUD";
     x20_NUD.Size     = new Size(40, 0x13);
     x20_NUD.TabIndex = 7;
     x1F_NUD.Location = new Point(100, 30);
     int[] numArray5 = new int[4];
     numArray5[0]     = 0xff;
     x1F_NUD.Maximum  = new decimal(numArray5);
     x1F_NUD.Name     = "x1F_NUD";
     x1F_NUD.Size     = new Size(40, 0x13);
     x1F_NUD.TabIndex = 5;
     label24.AutoSize = true;
     label24.Location = new Point(0x90, 15);
     label24.Name     = "label24";
     label24.Size     = new Size(0x17, 12);
     label24.TabIndex = 6;
     label24.Text     = "$20";
     x1D_NUD.Location = new Point(0x13c, 0xe8);
     x1D_NUD.Name     = "x1D_NUD";
     x1D_NUD.Size     = new Size(40, 0x13);
     x1D_NUD.TabIndex = 0x2f;
     x1A_NUD.Location = new Point(270, 0xe8);
     int[] numArray6 = new int[4];
     numArray6[0]    = 6;
     x1A_NUD.Maximum = new decimal(numArray6);
     int[] numArray7 = new int[4];
     numArray7[0]              = 6;
     numArray7[3]              = -2147483648;
     x1A_NUD.Minimum           = new decimal(numArray7);
     x1A_NUD.Name              = "x1A_NUD";
     x1A_NUD.Size              = new Size(40, 0x13);
     x1A_NUD.TabIndex          = 0x2e;
     x17_CoB.DropDownStyle     = ComboBoxStyle.DropDownList;
     x17_CoB.FormattingEnabled = true;
     x17_CoB.Location          = new Point(0xb8, 0xe7);
     x17_CoB.Name              = "x17_CoB";
     x17_CoB.Size              = new Size(80, 20);
     x17_CoB.TabIndex          = 0x2d;
     x1C_NUD.Location          = new Point(0x13c, 0xce);
     x1C_NUD.Name              = "x1C_NUD";
     x1C_NUD.Size              = new Size(40, 0x13);
     x1C_NUD.TabIndex          = 0x2c;
     x19_NUD.Location          = new Point(270, 0xce);
     int[] numArray8 = new int[4];
     numArray8[0]    = 6;
     x19_NUD.Maximum = new decimal(numArray8);
     int[] numArray9 = new int[4];
     numArray9[0]              = 6;
     numArray9[3]              = -2147483648;
     x19_NUD.Minimum           = new decimal(numArray9);
     x19_NUD.Name              = "x19_NUD";
     x19_NUD.Size              = new Size(40, 0x13);
     x19_NUD.TabIndex          = 0x2b;
     x16_CoB.DropDownStyle     = ComboBoxStyle.DropDownList;
     x16_CoB.FormattingEnabled = true;
     x16_CoB.Location          = new Point(0xb8, 0xcd);
     x16_CoB.Name              = "x16_CoB";
     x16_CoB.Size              = new Size(80, 20);
     x16_CoB.TabIndex          = 0x2a;
     x1B_NUD.Location          = new Point(0x13c, 180);
     x1B_NUD.Name              = "x1B_NUD";
     x1B_NUD.Size              = new Size(40, 0x13);
     x1B_NUD.TabIndex          = 0x29;
     x18_NUD.Location          = new Point(270, 180);
     int[] numArray10 = new int[4];
     numArray10[0]   = 6;
     x18_NUD.Maximum = new decimal(numArray10);
     int[] numArray11 = new int[4];
     numArray11[0]             = 6;
     numArray11[3]             = -2147483648;
     x18_NUD.Minimum           = new decimal(numArray11);
     x18_NUD.Name              = "x18_NUD";
     x18_NUD.Size              = new Size(40, 0x13);
     x18_NUD.TabIndex          = 40;
     x15_CoB.DropDownStyle     = ComboBoxStyle.DropDownList;
     x15_CoB.FormattingEnabled = true;
     x15_CoB.Location          = new Point(0xb8, 0xb3);
     x15_CoB.Name              = "x15_CoB";
     x15_CoB.Size              = new Size(80, 20);
     x15_CoB.TabIndex          = 0x27;
     label21.AutoSize          = true;
     label21.Location          = new Point(0x13a, 0xa4);
     label21.Name              = "label21";
     label21.Size              = new Size(0x1d, 12);
     label21.TabIndex          = 0x26;
     label21.Text              = "% Chance";
     label20.AutoSize          = true;
     label20.Location          = new Point(0x10c, 0xa4);
     label20.Name              = "label20";
     label20.Size              = new Size(0x29, 12);
     label20.TabIndex          = 0x25;
     label20.Text              = "Stages";
     label19.AutoSize          = true;
     label19.Location          = new Point(0xb6, 0xa4);
     label19.Name              = "label19";
     label19.Size              = new Size(0x1d, 12);
     label19.TabIndex          = 0x24;
     label19.Text              = "Stat";
     x14_CoB.DropDownStyle     = ComboBoxStyle.DropDownList;
     x14_CoB.FormattingEnabled = true;
     x14_CoB.Location          = new Point(0xf1, 0x56);
     x14_CoB.Name              = "x14_CoB";
     x14_CoB.Size              = new Size(0x9e, 20);
     x14_CoB.TabIndex          = 0x1f;
     label18.AutoSize          = true;
     label18.Location          = new Point(0xb6, 0x59);
     label18.Name              = "label18";
     label18.Size              = new Size(0x1d, 12);
     label18.TabIndex          = 30;
     label18.Text              = "Targeting";
     x13_NUD.Location          = new Point(90, 0x106);
     int[] numArray12 = new int[4];
     numArray12[0]    = 100;
     numArray12[3]    = -2147483648;
     x13_NUD.Minimum  = new decimal(numArray12);
     x13_NUD.Name     = "x13_NUD";
     x13_NUD.Size     = new Size(50, 0x13);
     x13_NUD.TabIndex = 0x17;
     label17.AutoSize = true;
     label17.Location = new Point(3, 0x108);
     label17.Name     = "label17";
     label17.Size     = new Size(0x4f, 12);
     label17.TabIndex = 0x16;
     label17.Text     = "Quantity";
     x12_NUD.Location = new Point(90, 0xed);
     int[] numArray13 = new int[4];
     numArray13[0]    = 100;
     numArray13[3]    = -2147483648;
     x12_NUD.Minimum  = new decimal(numArray13);
     x12_NUD.Name     = "x12_NUD";
     x12_NUD.Size     = new Size(50, 0x13);
     x12_NUD.TabIndex = 0x15;
     label16.AutoSize = true;
     label16.Location = new Point(3, 0xef);
     label16.Name     = "label16";
     label16.Size     = new Size(0x51, 12);
     label16.TabIndex = 20;
     label16.Text     = "DMG Heal %";
     x10_NUD.Location = new Point(90, 0xd4);
     int[] numArray14 = new int[4];
     numArray14[0]    = 0x181;
     x10_NUD.Maximum  = new decimal(numArray14);
     x10_NUD.Name     = "x10_NUD";
     x10_NUD.Size     = new Size(40, 0x13);
     x10_NUD.TabIndex = 0x13;
     label15.AutoSize = true;
     label15.Location = new Point(3, 0xd6);
     label15.Name     = "label15";
     label15.Size     = new Size(0x38, 12);
     label15.TabIndex = 0x12;
     label15.Text     = "Effect Code";
     x0F_NUD.Location = new Point(90, 0xbb);
     x0F_NUD.Name     = "x0F_NUD";
     x0F_NUD.Size     = new Size(40, 0x13);
     x0F_NUD.TabIndex = 0x11;
     label14.AutoSize = true;
     label14.Location = new Point(3, 0xbd);
     label14.Name     = "label14";
     label14.Size     = new Size(0x2f, 12);
     label14.TabIndex = 0x10;
     label14.Text     = "Flinch %";
     x0E_NUD.Location = new Point(90, 0xa2);
     int[] numArray15 = new int[4];
     numArray15[0]    = 6;
     x0E_NUD.Maximum  = new decimal(numArray15);
     x0E_NUD.Name     = "x0E_NUD";
     x0E_NUD.Size     = new Size(40, 0x13);
     x0E_NUD.TabIndex = 15;
     label13.AutoSize = true;
     label13.Location = new Point(3, 0xa4);
     label13.Name     = "label13";
     label13.Size     = new Size(0x29, 12);
     label13.TabIndex = 14;
     label13.Text     = "+Crit Stage";
     x0D_NUD.Location = new Point(0x88, 0x89);
     int[] numArray16 = new int[4];
     numArray16[0]    = 15;
     x0D_NUD.Maximum  = new decimal(numArray16);
     x0D_NUD.Name     = "x0D_NUD";
     x0D_NUD.Size     = new Size(40, 0x13);
     x0D_NUD.TabIndex = 13;
     x0C_NUD.Location = new Point(90, 0x89);
     int[] numArray17 = new int[4];
     numArray17[0]             = 15;
     x0C_NUD.Maximum           = new decimal(numArray17);
     x0C_NUD.Name              = "x0C_NUD";
     x0C_NUD.Size              = new Size(40, 0x13);
     x0C_NUD.TabIndex          = 12;
     label12.AutoSize          = true;
     label12.Location          = new Point(3, 0x8b);
     label12.Name              = "label12";
     label12.Size              = new Size(0x2c, 12);
     label12.TabIndex          = 11;
     label12.Text              = "Trap Turns";
     x0A_NUD.Location          = new Point(0xf1, 0x89);
     x0A_NUD.Name              = "x0A_NUD";
     x0A_NUD.Size              = new Size(40, 0x13);
     x0A_NUD.TabIndex          = 0x23;
     label10.AutoSize          = true;
     label10.Location          = new Point(0xb6, 0x8b);
     label10.Name              = "label10";
     label10.Size              = new Size(0x35, 12);
     label10.TabIndex          = 0x22;
     label10.Text              = "Inflict %";
     x08_CoB.DropDownStyle     = ComboBoxStyle.DropDownList;
     x08_CoB.FormattingEnabled = true;
     x08_CoB.Location          = new Point(0xf1, 0x6f);
     x08_CoB.Name              = "x08_CoB";
     x08_CoB.Size              = new Size(0x79, 20);
     x08_CoB.TabIndex          = 0x21;
     label9.AutoSize           = true;
     label9.Location           = new Point(0xb6, 0x72);
     label9.Name          = "label9";
     label9.Size          = new Size(0x35, 12);
     label9.TabIndex      = 0x20;
     label9.Text          = "Inflict";
     x07_MAX_NUD.Location = new Point(0x88, 0x70);
     int[] numArray18 = new int[4];
     numArray18[0]        = 15;
     x07_MAX_NUD.Maximum  = new decimal(numArray18);
     x07_MAX_NUD.Name     = "x07_MAX_NUD";
     x07_MAX_NUD.Size     = new Size(40, 0x13);
     x07_MAX_NUD.TabIndex = 10;
     x07_MIN_NUD.Location = new Point(90, 0x70);
     int[] numArray19 = new int[4];
     numArray19[0]        = 15;
     x07_MIN_NUD.Maximum  = new decimal(numArray19);
     x07_MIN_NUD.Name     = "x07_MIN_NUD";
     x07_MIN_NUD.Size     = new Size(40, 0x13);
     x07_MIN_NUD.TabIndex = 9;
     label8.AutoSize      = true;
     label8.Location      = new Point(3, 0x72);
     label8.Name          = "label8";
     label8.Size          = new Size(0x35, 12);
     label8.TabIndex      = 8;
     label8.Text          = "Multihit";
     x06_NUD.Location     = new Point(90, 0x57);
     int[] numArray20 = new int[4];
     numArray20[0]   = 5;
     x06_NUD.Maximum = new decimal(numArray20);
     int[] numArray21 = new int[4];
     numArray21[0]    = 7;
     numArray21[3]    = -2147483648;
     x06_NUD.Minimum  = new decimal(numArray21);
     x06_NUD.Name     = "x06_NUD";
     x06_NUD.Size     = new Size(40, 0x13);
     x06_NUD.TabIndex = 7;
     label7.AutoSize  = true;
     label7.Location  = new Point(3, 0x59);
     label7.Name      = "label7";
     label7.Size      = new Size(0x29, 12);
     label7.TabIndex  = 6;
     label7.Text      = "Priority";
     x05_NUD.Location = new Point(90, 0x3e);
     int[] numArray22 = new int[4];
     numArray22[0]    = 40;
     x05_NUD.Maximum  = new decimal(numArray22);
     x05_NUD.Name     = "x05_NUD";
     x05_NUD.Size     = new Size(40, 0x13);
     x05_NUD.TabIndex = 5;
     label6.AutoSize  = true;
     label6.Location  = new Point(3, 0x40);
     label6.Name      = "label6";
     label6.Size      = new Size(0x13, 12);
     label6.TabIndex  = 4;
     label6.Text      = "PP";
     x04_NUD.Location = new Point(90, 0x25);
     int[] numArray23 = new int[4];
     numArray23[0]    = 0x65;
     x04_NUD.Maximum  = new decimal(numArray23);
     x04_NUD.Name     = "x04_NUD";
     x04_NUD.Size     = new Size(40, 0x13);
     x04_NUD.TabIndex = 3;
     label5.AutoSize  = true;
     label5.Location  = new Point(3, 0x27);
     label5.Name      = "label5";
     label5.Size      = new Size(0x1d, 12);
     label5.TabIndex  = 2;
     label5.Text      = "Accuracy";
     x03_NUD.Location = new Point(90, 12);
     int[] numArray24 = new int[4];
     numArray24[0]                        = 0xff;
     x03_NUD.Maximum                      = new decimal(numArray24);
     x03_NUD.Name                         = "x03_NUD";
     x03_NUD.Size                         = new Size(40, 0x13);
     x03_NUD.TabIndex                     = 1;
     label4.AutoSize                      = true;
     label4.Location                      = new Point(3, 14);
     label4.Name                          = "label4";
     label4.Size                          = new Size(0x1d, 12);
     label4.TabIndex                      = 0;
     label4.Text                          = "Base Power";
     x02_CoB.DropDownStyle                = ComboBoxStyle.DropDownList;
     x02_CoB.FormattingEnabled            = true;
     x02_CoB.Location                     = new Point(0xf1, 0x3d);
     x02_CoB.Name                         = "x02_CoB";
     x02_CoB.Size                         = new Size(0x9e, 20);
     x02_CoB.TabIndex                     = 0x1d;
     label3.AutoSize                      = true;
     label3.Location                      = new Point(0xb6, 0x40);
     label3.Name                          = "label3";
     label3.Size                          = new Size(0x1d, 12);
     label3.TabIndex                      = 0x1c;
     label3.Text                          = "Class";
     x01_CoB.DropDownStyle                = ComboBoxStyle.DropDownList;
     x01_CoB.FormattingEnabled            = true;
     x01_CoB.Location                     = new Point(0xf1, 0x24);
     x01_CoB.Name                         = "x01_CoB";
     x01_CoB.Size                         = new Size(0x9e, 20);
     x01_CoB.TabIndex                     = 0x1b;
     label2.AutoSize                      = true;
     label2.Location                      = new Point(0xb6, 0x27);
     label2.Name                          = "label2";
     label2.Size                          = new Size(0x1d, 12);
     label2.TabIndex                      = 0x1a;
     label2.Text                          = "Category";
     x00_CoB.DropDownStyle                = ComboBoxStyle.DropDownList;
     x00_CoB.FormattingEnabled            = true;
     x00_CoB.Location                     = new Point(0xf1, 11);
     x00_CoB.Name                         = "x00_CoB";
     x00_CoB.Size                         = new Size(0x9e, 20);
     x00_CoB.TabIndex                     = 0x19;
     label1.AutoSize                      = true;
     label1.Location                      = new Point(0xb6, 14);
     label1.Name                          = "label1";
     label1.Size                          = new Size(0x9e, 12);
     label1.TabIndex                      = 0x18;
     label1.Text                          = "Type";
     okButton.Anchor                      = AnchorStyles.Right | AnchorStyles.Bottom;
     okButton.Location                    = new Point(380, 0x165);
     okButton.Name                        = "okButton";
     okButton.Size                        = new Size(0x4b, 0x17);
     okButton.TabIndex                    = 1;
     okButton.Text                        = "OK";
     okButton.UseVisualStyleBackColor     = true;
     okButton.Click                      += okButton_Click;
     cancelButton.Anchor                  = AnchorStyles.Right | AnchorStyles.Bottom;
     cancelButton.DialogResult            = DialogResult.Cancel;
     cancelButton.Location                = new Point(0x1cd, 0x165);
     cancelButton.Name                    = "cancelButton";
     cancelButton.Size                    = new Size(0x4b, 0x17);
     cancelButton.TabIndex                = 2;
     cancelButton.Text                    = "Cancel";
     cancelButton.UseVisualStyleBackColor = true;
     cancelButton.Click                  += cancelButton_Click;
     groupBox4.Controls.Add(searchButton);
     groupBox4.Controls.Add(searchComboBox);
     groupBox4.Controls.Add(searchTextBox);
     groupBox4.Dock        = DockStyle.Bottom;
     groupBox4.Location    = new Point(0, 0x110);
     groupBox4.Name        = "groupBox4";
     groupBox4.Size        = new Size(0x85, 0x4f);
     groupBox4.TabIndex    = 5;
     groupBox4.TabStop     = false;
     groupBox4.Text        = "Filter";
     searchButton.Location = new Point(6, 0x2c);
     searchButton.Name     = "searchButton";
     searchButton.Size     = new Size(0x7c, 0x17);
     searchButton.TabIndex = 2;
     searchButton.Text     = "Search";
     searchButton.UseVisualStyleBackColor = true;
     searchButton.Click              += searchButton_Click;
     searchComboBox.DropDownStyle     = ComboBoxStyle.DropDownList;
     searchComboBox.FormattingEnabled = true;
     searchComboBox.Items.AddRange(new object[] { "Begins with", "Includes", "Ends with" });
     searchComboBox.Location = new Point(0x37, 0x11);
     searchComboBox.Name     = "searchComboBox";
     searchComboBox.Size     = new Size(0x4b, 20);
     searchComboBox.TabIndex = 1;
     searchTextBox.Location  = new Point(6, 0x12);
     searchTextBox.Name      = "searchTextBox";
     searchTextBox.Size      = new Size(0x2b, 0x13);
     searchTextBox.TabIndex  = 0;
     AutoScaleDimensions     = new SizeF(6f, 12f);
     AutoScaleMode           = AutoScaleMode.Font;
     ClientSize = new Size(0x224, 0x188);
     Controls.Add(cancelButton);
     Controls.Add(okButton);
     Controls.Add(splitContainer1);
     FormBorderStyle = FormBorderStyle.FixedSingle;
     MaximizeBox     = false;
     Name            = "SkillForm";
     StartPosition   = FormStartPosition.CenterParent;
     Text            = "Move Editor";
     splitContainer1.Panel1.ResumeLayout(false);
     splitContainer1.Panel2.ResumeLayout(false);
     splitContainer1.Panel2.PerformLayout();
     splitContainer1.ResumeLayout(false);
     groupBox1.ResumeLayout(false);
     groupBox1.PerformLayout();
     x0B_NUD.EndInit();
     x21_NUD.EndInit();
     x1E_NUD.EndInit();
     x20_NUD.EndInit();
     x1F_NUD.EndInit();
     x1D_NUD.EndInit();
     x1A_NUD.EndInit();
     x1C_NUD.EndInit();
     x19_NUD.EndInit();
     x1B_NUD.EndInit();
     x18_NUD.EndInit();
     x13_NUD.EndInit();
     x12_NUD.EndInit();
     x10_NUD.EndInit();
     x0F_NUD.EndInit();
     x0E_NUD.EndInit();
     x0D_NUD.EndInit();
     x0C_NUD.EndInit();
     x0A_NUD.EndInit();
     x07_MAX_NUD.EndInit();
     x07_MIN_NUD.EndInit();
     x06_NUD.EndInit();
     x05_NUD.EndInit();
     x04_NUD.EndInit();
     x03_NUD.EndInit();
     groupBox4.ResumeLayout(false);
     groupBox4.PerformLayout();
     ResumeLayout(false);
 }
        /// <summary>
        /// Initialize the form and controls
        /// </summary>
        public Bar_Explorer(int iBarNumber)
        {
            pnlChart = new Panel();
            pnlInfo  = new Panel();
            toolTip  = new ToolTip();

            bar = 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") + ": " + (bar + 1).ToString() + " " +
                      Data.Time[bar].ToString(Data.DF) + " " +
                      Data.Time[bar].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[4];
            string [] btnNavigateText = new string [4] {
                "< !", "<", ">", "! >"
            };
            string[] btnNavigateTips = new string [4] {
                Language.T("Previous ambiguous bar."),
                Language.T("Previous bar."),
                Language.T("Next bar."),
                Language.T("Next ambiguous bar.")
            };

            for (int i = 0; i < 4; 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].UseVisualStyleBackColor = true;
                toolTip.SetToolTip(btnNavigate[i], btnNavigateTips[i]);
            }

            btnNavigate[0].Enabled = Backtester.AmbiguousBars > 0;
            btnNavigate[3].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     = bar + 1;
            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);
            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);
            brushBarBlack    = new SolidBrush(LayoutColors.ColorBarBlack);
            brushTradeLong   = new SolidBrush(LayoutColors.ColorTradeLong);
            brushTradeShort  = new SolidBrush(LayoutColors.ColorTradeShort);
            brushTradeClose  = new SolidBrush(LayoutColors.ColorTradeClose);

            penGrid             = new Pen(LayoutColors.ColorChartGrid);
            penGrid.DashStyle   = DashStyle.Dash;
            penGrid.DashPattern = new float[] { 4, 2 };
            penGridSolid        = new Pen(LayoutColors.ColorChartGrid);
            penAxes             = new Pen(LayoutColors.ColorChartFore);
            penCross            = new Pen(LayoutColors.ColorChartCross);
            penBarBorder        = new Pen(LayoutColors.ColorBarBorder);

            colorBarWight1 = Data.GetGradientColor(LayoutColors.ColorBarWhite, 30);
            colorBarWight2 = Data.GetGradientColor(LayoutColors.ColorBarWhite, -30);
            colorBarBlack1 = Data.GetGradientColor(LayoutColors.ColorBarBlack, 30);
            colorBarBlack2 = Data.GetGradientColor(LayoutColors.ColorBarBlack, -30);

            colorLongTrade1   = Data.GetGradientColor(LayoutColors.ColorTradeLong, 30);
            colorLongTrade2   = Data.GetGradientColor(LayoutColors.ColorTradeLong, -30);
            colorShortTrade1  = Data.GetGradientColor(LayoutColors.ColorTradeShort, 30);
            colorShortTrade2  = Data.GetGradientColor(LayoutColors.ColorTradeShort, -30);
            colorClosedTrade1 = Data.GetGradientColor(LayoutColors.ColorTradeClose, 30);
            colorClosedTrade2 = Data.GetGradientColor(LayoutColors.ColorTradeClose, -30);

            SetJournalPoints();

            return;
        }
        /// <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;
            progressBar.Maximum = 100;
            progressBar.Step    = 1;

            // 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);

            this.Resize += new EventHandler(PnlOverOptimization_Resize);
        }
Exemplo n.º 11
0
        /// <summary>
        ///     Public constructor.
        /// </summary>
        public OverOptimization(string caption) : base(caption)
        {
            lblIntro      = new Label();
            lblDeviation  = new Label();
            lblParams     = new Label();
            lblNoParams   = new Label();
            nudDeviation  = new NumericUpDown();
            nudParams     = new NumericUpDown();
            btnStart      = new Button();
            btnViewCharts = new Button();
            btnOpenFolder = new Button();
            btnOpenReport = new Button();
            progressBar   = new ProgressBar();

            Color colorText = LayoutColors.ColorControlText;

            CountStrategyParams();
            bool isParams = countStratParams > 0;

            // 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 results of the backtest vary as the numerical parameters of the strategy change by a 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]");

            // lblNoParams
            lblNoParams.Parent    = this;
            lblNoParams.Text      = Language.T("There are no parameters suitable for analysis.");
            lblNoParams.ForeColor = LayoutColors.ColorSignalRed;
            lblNoParams.BackColor = Color.Transparent;
            lblNoParams.AutoSize  = true;
            lblNoParams.Visible   = !isParams;

            // 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      = Resources.overoptimization_chart;
            btnViewCharts.Enabled    = false;
            btnViewCharts.Click     += ViewChartsClick;
            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      = Resources.folder_open;
            btnOpenFolder.Enabled    = false;
            btnOpenFolder.Click     += OpenFolderClick;
            btnOpenFolder.UseVisualStyleBackColor = true;

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

            // Button Start
            btnStart.Parent  = this;
            btnStart.Text    = Language.T("Start");
            btnStart.Enabled = isParams;
            btnStart.Click  += BtnStartClick;
            btnStart.UseVisualStyleBackColor = true;

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

            // BackgroundWorker
            bgWorker = new BackgroundWorker {
                WorkerReportsProgress = true, WorkerSupportsCancellation = true
            };
            bgWorker.DoWork             += BgWorkerDoWork;
            bgWorker.ProgressChanged    += BgWorkerProgressChanged;
            bgWorker.RunWorkerCompleted += BgWorkerRunWorkerCompleted;

            Resize += PnlOverOptimizationResize;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Trading_Charges()
        {
            pnlBase = new Fancy_Panel();

            lblSpread     = new Label();
            lblSwapLong   = new Label();
            lblSwapShort  = new Label();
            lblCommission = new Label();
            lblSlippage   = new Label();

            nudSpread     = new NumericUpDown();
            nudSwapLong   = new NumericUpDown();
            nudSwapShort  = new NumericUpDown();
            nudCommission = new NumericUpDown();
            nudSlippage   = new NumericUpDown();

            btnEditInstrument = new Button();
            btnAccept         = new Button();
            btnCancel         = new Button();

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

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = btnAccept;
            Text            = Language.T("Trading Charges") + " - " + Data.Symbol;

            // pnlBase
            pnlBase.Parent = this;

            // Label Spread
            lblSpread.Parent    = pnlBase;
            lblSpread.ForeColor = colorText;
            lblSpread.BackColor = Color.Transparent;
            lblSpread.AutoSize  = true;
            lblSpread.Text      = Language.T("Spread") + " [" + Language.T("pips") + "]";

            // Label Swap Long
            lblSwapLong.Parent    = pnlBase;
            lblSwapLong.ForeColor = colorText;
            lblSwapLong.BackColor = Color.Transparent;
            lblSwapLong.AutoSize  = true;
            lblSwapLong.Text      = Language.T("Swap number for a long position rollover") + " [" +
                                    (Data.InstrProperties.SwapType == Commission_Type.money ?
                                     Data.InstrProperties.PriceIn :
                                     Language.T(Data.InstrProperties.SwapType.ToString())) + "]" + Environment.NewLine +
                                    "(" + Language.T("A positive value decreases your profit.") + ")";

            // Label Swap Short
            lblSwapShort.Parent    = pnlBase;
            lblSwapShort.ForeColor = colorText;
            lblSwapShort.BackColor = Color.Transparent;
            lblSwapShort.AutoSize  = true;
            lblSwapShort.Text      = Language.T("Swap number for a short position rollover") + " [" +
                                     (Data.InstrProperties.SwapType == Commission_Type.money ?
                                      Data.InstrProperties.PriceIn :
                                      Language.T(Data.InstrProperties.SwapType.ToString())) + "]" + Environment.NewLine +
                                     "(" + Language.T("A negative value decreases your profit.") + ")";

            // Label Commission
            lblCommission.Parent    = pnlBase;
            lblCommission.ForeColor = colorText;
            lblCommission.BackColor = Color.Transparent;
            lblCommission.AutoSize  = true;
            lblCommission.Text      = Language.T("Commission in") + " " +
                                      Data.InstrProperties.CommissionTypeToString + " " +
                                      Data.InstrProperties.CommissionScopeToString + " " +
                                      Data.InstrProperties.CommissionTimeToString +
                                      (Data.InstrProperties.CommissionType == Commission_Type.money ? " [" + Data.InstrProperties.PriceIn + "]" : "");

            // Label Slippage
            lblSlippage.Parent    = pnlBase;
            lblSlippage.ForeColor = colorText;
            lblSlippage.BackColor = Color.Transparent;
            lblSlippage.AutoSize  = true;
            lblSlippage.Text      = Language.T("Slippage") + " [" + Language.T("pips") + "]";

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

            // NumericUpDown Swap Long
            nudSwapLong.BeginInit();
            nudSwapLong.Parent        = pnlBase;
            nudSwapLong.Name          = "SwapLong";
            nudSwapLong.TextAlign     = HorizontalAlignment.Center;
            nudSwapLong.Minimum       = -500;
            nudSwapLong.Maximum       = 500;
            nudSwapLong.Increment     = 0.01M;
            nudSwapLong.DecimalPlaces = 2;
            nudSwapLong.Value         = 1;
            nudSwapLong.EndInit();
            toolTip.SetToolTip(nudSwapLong, Language.T("A position changes its average price with the selected number during a rollover."));

            // NumericUpDown Swap Short
            nudSwapShort.BeginInit();
            nudSwapShort.Parent        = pnlBase;
            nudSwapShort.Name          = "SwapShort";
            nudSwapShort.TextAlign     = HorizontalAlignment.Center;
            nudSwapShort.Minimum       = -500;
            nudSwapShort.Maximum       = 500;
            nudSwapShort.Increment     = 0.01M;
            nudSwapShort.DecimalPlaces = 2;
            nudSwapShort.Value         = -1;
            nudSwapShort.EndInit();
            toolTip.SetToolTip(nudSwapShort, Language.T("A position changes its average price with the selected number during a rollover."));

            // NumericUpDown Commission
            nudCommission.BeginInit();
            nudCommission.Parent        = pnlBase;
            nudCommission.Name          = Language.T("Commission");
            nudCommission.TextAlign     = HorizontalAlignment.Center;
            nudCommission.Minimum       = -500;
            nudCommission.Maximum       = 500;
            nudCommission.Increment     = 0.01M;
            nudCommission.DecimalPlaces = 2;
            nudCommission.Value         = 0;
            nudCommission.EndInit();

            // NumericUpDown Slippage
            nudSlippage.BeginInit();
            nudSlippage.Parent    = pnlBase;
            nudSlippage.Name      = "Slippage";
            nudSlippage.TextAlign = HorizontalAlignment.Center;
            nudSlippage.Minimum   = 0;
            nudSlippage.Maximum   = 200;
            nudSlippage.Increment = 1;
            nudSlippage.Value     = 0;
            nudSlippage.EndInit();
            toolTip.SetToolTip(nudSlippage, Language.T("Number of pips you lose due to an inaccurate order execution."));

            //Button btnEditInstrument
            btnEditInstrument.Parent = this;
            btnEditInstrument.Name   = "EditInstrument";
            btnEditInstrument.Text   = Language.T("More");
            btnEditInstrument.Click += new EventHandler(BtnEditInstrument_Click);
            btnEditInstrument.UseVisualStyleBackColor = true;

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

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

            return;
        }
Exemplo n.º 13
0
        /// <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    += new FormClosingEventHandler(Actions_FormClosing);

            isPaintChart = false;

            //Button Calculate
            btnCalculate.Parent = this;
            btnCalculate.Name   = "btnCalculate";
            btnCalculate.Text   = Language.T("Calculate");
            btnCalculate.Click += new EventHandler(BtnCalculate_Click);
            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    += new PaintEventHandler(PnlChart_Paint);

            pnlOptions.Parent    = this;
            pnlOptions.ForeColor = LayoutColors.ColorControlText;
            pnlOptions.Paint    += new PaintEventHandler(PnlOptions_Paint);

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

            // 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);
            penRandBands     = new Pen(LayoutColors.ComparatorChartRandomBands);
            brushRandArea    = new SolidBrush(LayoutColors.ComparatorChartRandomArea);
            penBalance       = new Pen(LayoutColors.ComparatorChartBalanceLine);
            penBalance.Width = 2;

            // 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);

            Configs.TradeUntilMarginCall = false;

            return;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Instrument_Editor()
        {
            pnlInstruments   = new Fancy_Panel(Language.T("Instruments"));
            pnlProperties    = new Fancy_Panel(Language.T("Instrument Properties"));
            pnlAddInstrument = new Fancy_Panel(Language.T("Add an Instrument"));

            // Instruments' controls
            lbxInstruments = new ListBox();
            btnDelete      = new Button();
            btnUp          = new Button();
            btnDown        = new Button();

            // Properties' controls
            lblPropSymbol      = new Label();
            lblPropType        = new Label();
            lblPropComment     = new Label();
            lblPropDigits      = new Label();
            lblPropPoint       = new Label();
            lblPropLots        = new Label();
            lblPropSpread      = new Label();
            lblPropSwap        = new Label();
            lblPropCommission  = new Label();
            lblPropSlippage    = new Label();
            lblPropPriceIn     = new Label();
            lblPropAccountIn   = new Label();
            lblPropAccountRate = new Label();
            lblPropFileName    = new Label();
            lblPropDataFiles   = new Label();

            tbxPropSymbol      = new TextBox();
            tbxPropType        = new TextBox();
            tbxPropComment     = new TextBox();
            tbxPropPoint       = new TextBox();
            tbxPropSpread      = new TextBox();
            tbxPropSlippage    = new TextBox();
            tbxPropPriceIn     = new TextBox();
            tbxPropAccountIn   = new TextBox();
            tbxPropAccountRate = new TextBox();
            tbxPropFileName    = new TextBox();

            cbxPropSwap       = new ComboBox();
            cbxPropCommission = new ComboBox();
            cbxPropCommScope  = new ComboBox();
            cbxPropCommTime   = new ComboBox();

            nudPropDigits      = new NumericUpDown();
            nudPropLotSize     = new NumericUpDown();
            nudPropSpread      = new NumericUpDown();
            nudPropSwapLong    = new NumericUpDown();
            nudPropSwapShort   = new NumericUpDown();
            nudPropCommission  = new NumericUpDown();
            nudPropSlippage    = new NumericUpDown();
            nudPropAccountRate = new NumericUpDown();

            btnAccept = new Button();

            // Add an Instrument's controls
            lblAddInstrSymbol = new Label();
            lblAddInstrType   = new Label();
            tbxAddInstrSymbol = new TextBox();
            cbxAddInstrType   = new ComboBox();
            btnAddInstrAdd    = new Button();

            btnClose = new Button();

            font          = this.Font;
            fontCaption   = new Font(Font.FontFamily, 9);
            captionHeight = (float)Math.Max(fontCaption.Height, 18);
            colorText     = LayoutColors.ColorControlText;
            bNeedReset    = false;

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = btnAccept;
            Text            = Language.T("Instrument Editor");
            FormClosing    += new FormClosingEventHandler(Instrument_Editor_FormClosing);

            // pnlInstruments
            pnlInstruments.Parent = this;

            // pnlProperties
            pnlProperties.Parent = this;

            // pnlAddInstrument
            pnlAddInstrument.Parent = this;

            // lbxInstruments
            lbxInstruments.Parent    = pnlInstruments;
            lbxInstruments.BackColor = LayoutColors.ColorControlBack;
            //lbxInstruments.BorderStyle = BorderStyle.None;
            lbxInstruments.ForeColor = colorText;
            lbxInstruments.Items.AddRange(Instruments.SymbolList);

            // Button UP
            btnUp.Parent = pnlInstruments;
            btnUp.Text   = Language.T("Up");
            btnUp.UseVisualStyleBackColor = true;
            btnUp.Click += new EventHandler(BtnUp_Click);

            // Button Down
            btnDown.Parent = pnlInstruments;
            btnDown.Text   = Language.T("Down");
            btnDown.UseVisualStyleBackColor = true;
            btnDown.Click += new EventHandler(BtnDown_Click);

            // Button Delete
            btnDelete.Parent = pnlInstruments;
            btnDelete.Text   = Language.T("Delete");
            btnDelete.UseVisualStyleBackColor = true;
            btnDelete.Click += new EventHandler(BtnDelete_Click);

            // lblAddInstrSymbol
            lblAddInstrSymbol.Parent    = pnlAddInstrument;
            lblAddInstrSymbol.ForeColor = colorText;
            lblAddInstrSymbol.BackColor = Color.Transparent;
            lblAddInstrSymbol.AutoSize  = false;
            lblAddInstrSymbol.TextAlign = ContentAlignment.MiddleRight;
            lblAddInstrSymbol.Text      = Language.T("Symbol");

            // tbxAddInstrSymbol
            tbxAddInstrSymbol.Parent    = pnlAddInstrument;
            tbxAddInstrSymbol.ForeColor = colorText;

            // lblAddInstrType
            lblAddInstrType.Parent    = pnlAddInstrument;
            lblAddInstrType.ForeColor = colorText;
            lblAddInstrType.BackColor = Color.Transparent;
            lblAddInstrType.AutoSize  = false;
            lblAddInstrType.TextAlign = ContentAlignment.MiddleRight;
            lblAddInstrType.Text      = Language.T("Type");

            // cbxAddInstrType
            cbxAddInstrType.Parent        = pnlAddInstrument;
            cbxAddInstrType.Name          = "cbxAddInstrType";
            cbxAddInstrType.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxAddInstrType.Items.AddRange(Enum.GetNames(typeof(Instrumet_Type)));
            cbxAddInstrType.SelectedIndex = 0;

            // btnAddInstrAdd
            btnAddInstrAdd.Parent = pnlAddInstrument;
            btnAddInstrAdd.Name   = "btnAddInstrAdd";
            btnAddInstrAdd.Text   = Language.T("Add");
            btnAddInstrAdd.UseVisualStyleBackColor = true;
            btnAddInstrAdd.Click += new EventHandler(BtnAddInstrAdd_Click);

            // pnlProperties
            lblPropSymbol.Parent    = pnlProperties;
            lblPropSymbol.ForeColor = colorText;
            lblPropSymbol.BackColor = Color.Transparent;
            lblPropSymbol.AutoSize  = false;
            lblPropSymbol.TextAlign = ContentAlignment.MiddleRight;
            lblPropSymbol.Text      = Language.T("Symbol");

            // lblPropType
            lblPropType.Parent    = pnlProperties;
            lblPropType.ForeColor = colorText;
            lblPropType.BackColor = Color.Transparent;
            lblPropType.AutoSize  = false;
            lblPropType.TextAlign = ContentAlignment.MiddleRight;
            lblPropType.Text      = Language.T("Type");

            // lblPropComment
            lblPropComment.Parent    = pnlProperties;
            lblPropComment.ForeColor = colorText;
            lblPropComment.BackColor = Color.Transparent;
            lblPropComment.AutoSize  = false;
            lblPropComment.TextAlign = ContentAlignment.MiddleRight;
            lblPropComment.Text      = Language.T("Comment");

            // lblPropDigits
            lblPropDigits.Parent    = pnlProperties;
            lblPropDigits.ForeColor = colorText;
            lblPropDigits.BackColor = Color.Transparent;
            lblPropDigits.AutoSize  = false;
            lblPropDigits.TextAlign = ContentAlignment.MiddleRight;
            lblPropDigits.Text      = Language.T("Digits");

            // lblPropPoint
            lblPropPoint.Parent    = pnlProperties;
            lblPropPoint.ForeColor = colorText;
            lblPropPoint.BackColor = Color.Transparent;
            lblPropPoint.AutoSize  = false;
            lblPropPoint.TextAlign = ContentAlignment.MiddleRight;
            lblPropPoint.Text      = Language.T("Point value");

            // lblPropLots
            lblPropLots.Parent    = pnlProperties;
            lblPropLots.ForeColor = colorText;
            lblPropLots.BackColor = Color.Transparent;
            lblPropLots.AutoSize  = false;
            lblPropLots.TextAlign = ContentAlignment.MiddleRight;
            lblPropLots.Text      = Language.T("Lot size");

            // lblPropSpread
            lblPropSpread.Parent    = pnlProperties;
            lblPropSpread.ForeColor = colorText;
            lblPropSpread.BackColor = Color.Transparent;
            lblPropSpread.AutoSize  = false;
            lblPropSpread.TextAlign = ContentAlignment.MiddleRight;
            lblPropSpread.Text      = Language.T("Spread in");

            // lblPropSwap
            lblPropSwap.Parent    = pnlProperties;
            lblPropSwap.ForeColor = colorText;
            lblPropSwap.BackColor = Color.Transparent;
            lblPropSwap.AutoSize  = false;
            lblPropSwap.TextAlign = ContentAlignment.MiddleRight;
            lblPropSwap.Text      = Language.T("Swap in");

            // lblPropCommission
            lblPropCommission.Parent    = pnlProperties;
            lblPropCommission.ForeColor = colorText;
            lblPropCommission.BackColor = Color.Transparent;
            lblPropCommission.AutoSize  = false;
            lblPropCommission.TextAlign = ContentAlignment.MiddleRight;
            lblPropCommission.Text      = Language.T("Commission in");

            // lblPropSlippage
            lblPropSlippage.Parent    = pnlProperties;
            lblPropSlippage.ForeColor = colorText;
            lblPropSlippage.BackColor = Color.Transparent;
            lblPropSlippage.AutoSize  = false;
            lblPropSlippage.TextAlign = ContentAlignment.MiddleRight;
            lblPropSlippage.Text      = Language.T("Slippage in");

            // lblPropPriceIn
            lblPropPriceIn.Parent    = pnlProperties;
            lblPropPriceIn.ForeColor = colorText;
            lblPropPriceIn.BackColor = Color.Transparent;
            lblPropPriceIn.AutoSize  = false;
            lblPropPriceIn.TextAlign = ContentAlignment.MiddleRight;
            lblPropPriceIn.Text      = Language.T("Price in");

            // lblPropAccountIn
            lblPropAccountIn.Parent    = pnlProperties;
            lblPropAccountIn.ForeColor = colorText;
            lblPropAccountIn.BackColor = Color.Transparent;
            lblPropAccountIn.AutoSize  = false;
            lblPropAccountIn.TextAlign = ContentAlignment.MiddleRight;
            lblPropAccountIn.Text      = Language.T("Account in");

            // lblPropAccountRate
            lblPropAccountRate.Parent    = pnlProperties;
            lblPropAccountRate.ForeColor = colorText;
            lblPropAccountRate.BackColor = Color.Transparent;
            lblPropAccountRate.AutoSize  = false;
            lblPropAccountRate.TextAlign = ContentAlignment.MiddleRight;
            lblPropAccountRate.Text      = Language.T("Account exchange rate");

            // lblPropFileName
            lblPropFileName.Parent    = pnlProperties;
            lblPropFileName.BackColor = Color.Transparent;
            lblPropFileName.ForeColor = colorText;
            lblPropFileName.AutoSize  = false;
            lblPropFileName.TextAlign = ContentAlignment.MiddleRight;
            lblPropFileName.Text      = Language.T("Base name of the data files");

            // lblPropDataFiles
            lblPropDataFiles.Parent    = pnlProperties;
            lblPropDataFiles.BackColor = Color.Transparent;
            lblPropDataFiles.ForeColor = colorText;
            lblPropDataFiles.AutoSize  = false;
            lblPropDataFiles.TextAlign = ContentAlignment.TopLeft;
            lblPropDataFiles.Text      = "";

            // tbxPropSymbol
            tbxPropSymbol.Parent    = pnlProperties;
            tbxPropSymbol.BackColor = LayoutColors.ColorControlBack;
            tbxPropSymbol.ForeColor = colorText;
            tbxPropSymbol.Enabled   = false;

            // tbxPropType
            tbxPropType.Parent    = pnlProperties;
            tbxPropType.BackColor = LayoutColors.ColorControlBack;
            tbxPropType.ForeColor = colorText;
            tbxPropType.Enabled   = false;

            // tbxPropComment
            tbxPropComment.Parent    = pnlProperties;
            tbxPropComment.BackColor = LayoutColors.ColorControlBack;
            tbxPropComment.ForeColor = colorText;

            // tbxPropPoint
            tbxPropPoint.Parent    = pnlProperties;
            tbxPropPoint.BackColor = LayoutColors.ColorControlBack;
            tbxPropPoint.ForeColor = colorText;
            tbxPropPoint.Enabled   = false;

            // tbxPropSpread
            tbxPropSpread.Parent    = pnlProperties;
            tbxPropSpread.BackColor = LayoutColors.ColorControlBack;
            tbxPropSpread.ForeColor = colorText;
            tbxPropSpread.Enabled   = false;
            tbxPropSpread.Text      = Language.T("pips");

            // tbxPropSlippage
            tbxPropSlippage.Parent    = pnlProperties;
            tbxPropSlippage.BackColor = LayoutColors.ColorControlBack;
            tbxPropSlippage.ForeColor = colorText;
            tbxPropSlippage.Enabled   = false;
            tbxPropSlippage.Text      = Language.T("pips");

            // tbxPropPriceIn
            tbxPropPriceIn.Parent       = pnlProperties;
            tbxPropPriceIn.BackColor    = LayoutColors.ColorControlBack;
            tbxPropPriceIn.ForeColor    = colorText;
            tbxPropPriceIn.TextChanged += new EventHandler(TbxPropPriceIn_TextChanged);

            // tbxPropAccountIn
            tbxPropAccountIn.Parent    = pnlProperties;
            tbxPropAccountIn.BackColor = LayoutColors.ColorControlBack;
            tbxPropAccountIn.ForeColor = colorText;
            tbxPropAccountIn.Enabled   = false;
            tbxPropAccountIn.Text      = Configs.AccountCurrency;

            // tbxPropAccountRate
            tbxPropAccountRate.Parent    = pnlProperties;
            tbxPropAccountRate.BackColor = LayoutColors.ColorControlBack;
            tbxPropAccountRate.ForeColor = colorText;
            tbxPropAccountRate.Enabled   = false;
            tbxPropAccountRate.Text      = "Deal price";

            // tbxPropFileName
            tbxPropFileName.Parent       = pnlProperties;
            tbxPropFileName.BackColor    = LayoutColors.ColorControlBack;
            tbxPropFileName.ForeColor    = colorText;
            tbxPropFileName.TextChanged += new EventHandler(TbxPropFileName_TextChanged);

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

            // 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;
            nudPropSwapLong.Increment     = 0.01M;
            nudPropSwapLong.DecimalPlaces = 2;
            nudPropSwapLong.Value         = 1;
            nudPropSwapLong.EndInit();
            toolTip.SetToolTip(nudPropSwapLong, Language.T("Swap number for a long position rollover") + Environment.NewLine + Language.T("A positive value decreases your profit."));

            // NumericUpDown Swap Short
            nudPropSwapShort.BeginInit();
            nudPropSwapShort.Parent        = pnlProperties;
            nudPropSwapShort.Name          = "nudPropSwapShort";
            nudPropSwapShort.TextAlign     = HorizontalAlignment.Center;
            nudPropSwapShort.Minimum       = -500;
            nudPropSwapShort.Maximum       = 500;
            nudPropSwapShort.Increment     = 0.01M;
            nudPropSwapShort.DecimalPlaces = 2;
            nudPropSwapShort.Value         = -1;
            nudPropSwapShort.EndInit();
            toolTip.SetToolTip(nudPropSwapShort, Language.T("Swap number for a short position rollover") + Environment.NewLine + Language.T("A negative value decreases your profit."));

            // NumericUpDown nudPropCommission
            nudPropCommission.BeginInit();
            nudPropCommission.Parent        = pnlProperties;
            nudPropCommission.Name          = "nudPropCommission";
            nudPropCommission.TextAlign     = HorizontalAlignment.Center;
            nudPropCommission.Minimum       = -500;
            nudPropCommission.Maximum       = 500;
            nudPropCommission.Increment     = 0.01M;
            nudPropCommission.DecimalPlaces = 2;
            nudPropCommission.Value         = 0;
            nudPropCommission.EndInit();

            // NumericUpDown nudPropSlippage
            nudPropSlippage.BeginInit();
            nudPropSlippage.Parent        = pnlProperties;
            nudPropSlippage.Name          = "nudPropSlippage";
            nudPropSlippage.TextAlign     = HorizontalAlignment.Center;
            nudPropSlippage.Minimum       = 0;
            nudPropSlippage.Maximum       = 200;
            nudPropSlippage.Increment     = 1;
            nudPropSlippage.DecimalPlaces = 0;
            nudPropSlippage.Value         = 0;
            nudPropSlippage.EndInit();
            toolTip.SetToolTip(nudPropSlippage, Language.T("Number of pips you lose due to an inaccurate order execution."));

            // NumericUpDown nudPropAccountRate
            nudPropAccountRate.BeginInit();
            nudPropAccountRate.Parent        = pnlProperties;
            nudPropAccountRate.Name          = "nudPropAccountRate";
            nudPropAccountRate.TextAlign     = HorizontalAlignment.Center;
            nudPropAccountRate.Minimum       = 0;
            nudPropAccountRate.Maximum       = 100000;
            nudPropAccountRate.Increment     = 0.0001M;
            nudPropAccountRate.DecimalPlaces = 4;
            nudPropAccountRate.Value         = 1;
            nudPropAccountRate.ValueChanged += new EventHandler(nudPropAccountRate_ValueChanged);
            nudPropAccountRate.EndInit();

            // Button Accept
            btnAccept.Parent = pnlProperties;
            btnAccept.Name   = "btnAccept";
            btnAccept.Text   = Language.T("Accept");
            btnAccept.Click += new EventHandler(BtnAccept_Click);
            btnAccept.UseVisualStyleBackColor = true;

            //Button Close
            btnClose.Parent                  = this;
            btnClose.Text                    = Language.T("Close");
            btnClose.DialogResult            = DialogResult.Cancel;
            btnClose.UseVisualStyleBackColor = true;
        }
Exemplo n.º 15
0
        /// <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();
            LblDestFolder  = new Label();
            TxbDestFolder  = new TextBox();
            BtnDestFolder  = new Button();

            _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();

            // LblDestFolder
            LblDestFolder.Parent    = PnlSettings;
            LblDestFolder.ForeColor = LayoutColors.ColorControlText;
            LblDestFolder.BackColor = Color.Transparent;
            LblDestFolder.AutoSize  = true;
            LblDestFolder.Text      = Language.T("Select a destination folder") + ":";

            // TxbDestFolder
            TxbDestFolder.Parent    = PnlSettings;
            TxbDestFolder.BackColor = LayoutColors.ColorControlBack;
            TxbDestFolder.ForeColor = LayoutColors.ColorControlText;
            TxbDestFolder.Text      = String.IsNullOrEmpty(Configs.JForexImportDestFolder) ? Data.OfflineDataDir : Configs.JForexImportDestFolder;

            // BtnDestFolder
            BtnDestFolder.Parent = PnlSettings;
            BtnDestFolder.Name   = "BtnDestFolder";
            BtnDestFolder.Text   = Language.T("Browse");
            BtnDestFolder.Click += BtnDestFolderClick;
            BtnDestFolder.UseVisualStyleBackColor = true;

            // 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;
            TbxInfo.AcceptsReturn = true;
            TbxInfo.AcceptsTab    = true;
            TbxInfo.ScrollBars    = ScrollBars.Vertical;

            // ProgressBar
            ProgressBar.Parent = this;

            // Button Help
            BtnHelp.Parent = this;
            BtnHelp.Name   = "Help";
            BtnHelp.Text   = Language.T("Help");
            BtnHelp.Click += BtnHelpClick;
            BtnHelp.UseVisualStyleBackColor = true;

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

            // Button Import
            BtnImport.Parent = this;
            BtnImport.Name   = "Import";
            BtnImport.Text   = Language.T("Import");
            BtnImport.Click += BtnImportClick;
            BtnImport.UseVisualStyleBackColor = true;

            // BackGroundWorker
            _bgWorker = new BackgroundWorker {
                WorkerReportsProgress = true, WorkerSupportsCancellation = true
            };
            _bgWorker.DoWork             += BgWorkerDoWork;
            _bgWorker.RunWorkerCompleted += BgWorkerRunWorkerCompleted;
        }
Exemplo n.º 16
0
        /// <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);
            _penRandBands   = new Pen(LayoutColors.ComparatorChartRandomBands);
            _brushRandArea  = new SolidBrush(LayoutColors.ComparatorChartRandomArea);
            _penBalance     = new Pen(LayoutColors.ComparatorChartBalanceLine)
            {
                Width = 2
            };

            // BackGroundWorker
            _bgWorker = new BackgroundWorker {
                WorkerReportsProgress = true, WorkerSupportsCancellation = true
            };
            _bgWorker.DoWork             += BgWorkerDoWork;
            _bgWorker.ProgressChanged    += BgWorkerProgressChanged;
            _bgWorker.RunWorkerCompleted += BgWorkerRunWorkerCompleted;

            Configs.TradeUntilMarginCall = false;
        }
Exemplo n.º 17
0
        /// <summary>
        /// Constructor
        /// </summary>
        public TradeSettings()
        {
            PnlSettings = new FancyPanel();

            LblCloseAdvance  = new Label();
            LblSlippageEntry = new Label();

            CbxLongLogicPrice = new ComboBox();
            ChbAutoSlippage   = new CheckBox();
            NUDCloseAdvance   = new NumericUpDown();
            NUDSlippageEntry  = new NumericUpDown();
            NUDSlippageExit   = new NumericUpDown();
            LblSlippageExit   = new Label();
            LblLongLogicPrice = new Label();
            LblMinChartBars   = new Label();
            NUDMinChartBars   = new NumericUpDown();

            BtnDefault = new Button();
            BtnCancel  = new Button();
            BtnAccept  = new Button();

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = BtnAccept;
            Text            = Language.T("Trade Settings");

            // pnlAveraging
            PnlSettings.Parent = this;

            // ComboBox Long Logic Price
            CbxLongLogicPrice.Parent        = PnlSettings;
            CbxLongLogicPrice.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxLongLogicPrice.Items.AddRange(new object[] { "Bid", "Ask", "Chart" });
            CbxLongLogicPrice.Text = Configs.LongTradeLogicPrice;

            // Label close advance
            LblCloseAdvance.Parent    = PnlSettings;
            LblCloseAdvance.ForeColor = LayoutColors.ColorControlText;
            LblCloseAdvance.BackColor = Color.Transparent;
            LblCloseAdvance.AutoSize  = true;
            LblCloseAdvance.Text      = Language.T("'Bar Closing' time advance in seconds");

            // Check Box Auto Slippage
            ChbAutoSlippage.Parent          = PnlSettings;
            ChbAutoSlippage.ForeColor       = LayoutColors.ColorControlText;
            ChbAutoSlippage.BackColor       = Color.Transparent;
            ChbAutoSlippage.AutoSize        = true;
            ChbAutoSlippage.Checked         = Configs.AutoSlippage;
            ChbAutoSlippage.Text            = Language.T("Auto slippage depending on the spread.");
            ChbAutoSlippage.CheckedChanged += ChbAutoSlippageCheckedChanged;

            // Label Entry slippage
            LblSlippageEntry.Parent    = PnlSettings;
            LblSlippageEntry.ForeColor = LayoutColors.ColorControlText;
            LblSlippageEntry.BackColor = Color.Transparent;
            LblSlippageEntry.AutoSize  = true;
            LblSlippageEntry.Text      = Language.T("Slippage for entry orders");

            // Label Entry slippage
            LblSlippageExit.Parent    = PnlSettings;
            LblSlippageExit.ForeColor = LayoutColors.ColorControlText;
            LblSlippageExit.BackColor = Color.Transparent;
            LblSlippageExit.AutoSize  = true;
            LblSlippageExit.Text      = Language.T("Slippage for exit orders");

            // NumericUpDown Entry Lots
            NUDCloseAdvance.Parent = PnlSettings;
            NUDCloseAdvance.BeginInit();
            NUDCloseAdvance.Minimum       = 1;
            NUDCloseAdvance.Maximum       = 15;
            NUDCloseAdvance.Increment     = 1;
            NUDCloseAdvance.Value         = Configs.BarCloseAdvance;
            NUDCloseAdvance.DecimalPlaces = 0;
            NUDCloseAdvance.TextAlign     = HorizontalAlignment.Center;
            NUDCloseAdvance.EndInit();

            // Label lblLongLogicPrice
            LblLongLogicPrice.Parent    = PnlSettings;
            LblLongLogicPrice.ForeColor = LayoutColors.ColorControlText;
            LblLongLogicPrice.BackColor = Color.Transparent;
            LblLongLogicPrice.AutoSize  = true;
            LblLongLogicPrice.Text      = Language.T("Long logic rules base price");

            // NUD Entry slippage
            NUDSlippageEntry.Parent = PnlSettings;
            NUDSlippageEntry.BeginInit();
            NUDSlippageEntry.Minimum       = 0;
            NUDSlippageEntry.Maximum       = 1000;
            NUDSlippageEntry.Increment     = 1;
            NUDSlippageEntry.Value         = Configs.SlippageEntry;
            NUDSlippageEntry.DecimalPlaces = 0;
            NUDSlippageEntry.TextAlign     = HorizontalAlignment.Center;
            NUDSlippageEntry.Enabled       = !Configs.AutoSlippage;
            NUDSlippageEntry.EndInit();

            // NUD Exit slippage
            NUDSlippageExit.Parent = PnlSettings;
            NUDSlippageExit.BeginInit();
            NUDSlippageExit.Minimum       = 0;
            NUDSlippageExit.Maximum       = 1000;
            NUDSlippageExit.Increment     = 1;
            NUDSlippageExit.Value         = Configs.SlippageExit;
            NUDSlippageExit.DecimalPlaces = 0;
            NUDSlippageExit.TextAlign     = HorizontalAlignment.Center;
            NUDSlippageExit.Enabled       = !Configs.AutoSlippage;
            NUDSlippageExit.EndInit();

            // Label lblMinChartBars
            LblMinChartBars.Parent    = PnlSettings;
            LblMinChartBars.ForeColor = LayoutColors.ColorControlText;
            LblMinChartBars.BackColor = Color.Transparent;
            LblMinChartBars.AutoSize  = true;
            LblMinChartBars.Text      = Language.T("Minimum number of bars in the chart");

            // NUD Exit slippage
            NUDMinChartBars.Parent = PnlSettings;
            NUDMinChartBars.BeginInit();
            NUDMinChartBars.Minimum       = 300;
            NUDMinChartBars.Maximum       = 10000;
            NUDMinChartBars.Increment     = 1;
            NUDMinChartBars.Value         = Configs.MinChartBars;
            NUDMinChartBars.DecimalPlaces = 0;
            NUDMinChartBars.TextAlign     = HorizontalAlignment.Center;
            NUDMinChartBars.EndInit();

            //Button Default
            BtnDefault.Parent = this;
            BtnDefault.Name   = "Default";
            BtnDefault.Text   = Language.T("Default");
            BtnDefault.Click += BtnDefaultClick;
            BtnDefault.UseVisualStyleBackColor = true;

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

            //Button Accept
            BtnAccept.Parent                  = this;
            BtnAccept.Name                    = "Accept";
            BtnAccept.Text                    = Language.T("Accept");
            BtnAccept.Click                  += BtnAcceptClick;
            BtnAccept.DialogResult            = DialogResult.OK;
            BtnAccept.UseVisualStyleBackColor = true;
        }
Exemplo n.º 18
0
 private void InitializeComponent()
 {
     panel1          = new Panel();
     splitContainer1 = new SplitContainer();
     placeListBox    = new ListBox();
     groupBox3       = new GroupBox();
     readBinButton   = new Button();
     writeBinButton  = new Button();
     groupBox2       = new GroupBox();
     x07_NUD         = new NumericUpDown();
     x06_NUD         = new NumericUpDown();
     x03_NUD         = new NumericUpDown();
     x05_NUD         = new NumericUpDown();
     x02_NUD         = new NumericUpDown();
     x04_NUD         = new NumericUpDown();
     x01_NUD         = new NumericUpDown();
     x00_NUD         = new NumericUpDown();
     label8          = new Label();
     label7          = new Label();
     label6          = new Label();
     label5          = new Label();
     label4          = new Label();
     label3          = new Label();
     label2          = new Label();
     label1          = new Label();
     groupBox1       = new GroupBox();
     maxLvButton     = new Button();
     minLvButton     = new Button();
     pokeButton      = new Button();
     dgv             = new DataGridView();
     Column1         = new DataGridViewTextBoxColumn();
     Column2         = new DataGridViewTextBoxColumn();
     Column3         = new DataGridViewTextBoxColumn();
     Column4         = new DataGridViewTextBoxColumn();
     okButton        = new Button();
     cancelButton    = new Button();
     ofd             = new OpenFileDialog();
     sfd             = new SaveFileDialog();
     panel1.SuspendLayout();
     splitContainer1.Panel1.SuspendLayout();
     splitContainer1.Panel2.SuspendLayout();
     splitContainer1.SuspendLayout();
     groupBox3.SuspendLayout();
     groupBox2.SuspendLayout();
     x07_NUD.BeginInit();
     x06_NUD.BeginInit();
     x03_NUD.BeginInit();
     x05_NUD.BeginInit();
     x02_NUD.BeginInit();
     x04_NUD.BeginInit();
     x01_NUD.BeginInit();
     x00_NUD.BeginInit();
     groupBox1.SuspendLayout();
     ((ISupportInitialize)dgv).BeginInit();
     SuspendLayout();
     panel1.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
     panel1.Controls.Add(splitContainer1);
     panel1.Location          = new Point(0, 0);
     panel1.Name              = "panel1";
     panel1.Size              = new Size(0x310, 0x206);
     panel1.TabIndex          = 0;
     splitContainer1.Dock     = DockStyle.Fill;
     splitContainer1.Location = new Point(0, 0);
     splitContainer1.Name     = "splitContainer1";
     splitContainer1.Panel1.Controls.Add(placeListBox);
     splitContainer1.Panel2.Controls.Add(groupBox3);
     splitContainer1.Panel2.Controls.Add(groupBox2);
     splitContainer1.Panel2.Controls.Add(groupBox1);
     splitContainer1.Size             = new Size(0x310, 0x206);
     splitContainer1.SplitterDistance = 0xb6;
     splitContainer1.TabIndex         = 0;
     placeListBox.Dock = DockStyle.Fill;
     placeListBox.FormattingEnabled = true;
     placeListBox.ItemHeight        = 12;
     placeListBox.Location          = new Point(0, 0);
     placeListBox.Name     = "placeListBox";
     placeListBox.Size     = new Size(0xb6, 0x1fc);
     placeListBox.TabIndex = 0;
     groupBox3.Controls.Add(readBinButton);
     groupBox3.Controls.Add(writeBinButton);
     groupBox3.Location     = new Point(400, 0x1c9);
     groupBox3.Name         = "groupBox3";
     groupBox3.Size         = new Size(0xc3, 0x3a);
     groupBox3.TabIndex     = 3;
     groupBox3.TabStop      = false;
     groupBox3.Text         = "Encounter Slot Backup (.bin)";
     readBinButton.Location = new Point(100, 0x16);
     readBinButton.Name     = "readBinButton";
     readBinButton.Size     = new Size(0x4b, 0x17);
     readBinButton.TabIndex = 4;
     readBinButton.Text     = "Import";
     readBinButton.UseVisualStyleBackColor = true;
     readBinButton.Click    += readBinButton_Click;
     writeBinButton.Location = new Point(0x13, 0x16);
     writeBinButton.Name     = "writeBinButton";
     writeBinButton.Size     = new Size(0x4b, 0x17);
     writeBinButton.TabIndex = 3;
     writeBinButton.Text     = "Export";
     writeBinButton.UseVisualStyleBackColor = true;
     writeBinButton.Click += writeBinButton_Click;
     groupBox2.Anchor      = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
     groupBox2.Controls.Add(x07_NUD);
     groupBox2.Controls.Add(x06_NUD);
     groupBox2.Controls.Add(x03_NUD);
     groupBox2.Controls.Add(x05_NUD);
     groupBox2.Controls.Add(x02_NUD);
     groupBox2.Controls.Add(x04_NUD);
     groupBox2.Controls.Add(x01_NUD);
     groupBox2.Controls.Add(x00_NUD);
     groupBox2.Controls.Add(label8);
     groupBox2.Controls.Add(label7);
     groupBox2.Controls.Add(label6);
     groupBox2.Controls.Add(label5);
     groupBox2.Controls.Add(label4);
     groupBox2.Controls.Add(label3);
     groupBox2.Controls.Add(label2);
     groupBox2.Controls.Add(label1);
     groupBox2.Location = new Point(3, 0x1c9);
     groupBox2.Name     = "groupBox2";
     groupBox2.Size     = new Size(0x187, 0x3a);
     groupBox2.TabIndex = 1;
     groupBox2.TabStop  = false;
     groupBox2.Text     = "Habitat Header";
     x07_NUD.Location   = new Point(330, 30);
     int[] bits = new int[4];
     bits[0]          = 0xff;
     x07_NUD.Maximum  = new decimal(bits);
     x07_NUD.Name     = "x07_NUD";
     x07_NUD.Size     = new Size(40, 0x13);
     x07_NUD.TabIndex = 8;
     x06_NUD.Location = new Point(0x11c, 30);
     int[] numArray2 = new int[4];
     numArray2[0]     = 0xff;
     x06_NUD.Maximum  = new decimal(numArray2);
     x06_NUD.Name     = "x06_NUD";
     x06_NUD.Size     = new Size(40, 0x13);
     x06_NUD.TabIndex = 8;
     x03_NUD.Location = new Point(0x92, 30);
     int[] numArray3 = new int[4];
     numArray3[0]     = 0xff;
     x03_NUD.Maximum  = new decimal(numArray3);
     x03_NUD.Name     = "x03_NUD";
     x03_NUD.Size     = new Size(40, 0x13);
     x03_NUD.TabIndex = 8;
     x05_NUD.Location = new Point(0xee, 30);
     int[] numArray4 = new int[4];
     numArray4[0]     = 0xff;
     x05_NUD.Maximum  = new decimal(numArray4);
     x05_NUD.Name     = "x05_NUD";
     x05_NUD.Size     = new Size(40, 0x13);
     x05_NUD.TabIndex = 8;
     x02_NUD.Location = new Point(100, 30);
     int[] numArray5 = new int[4];
     numArray5[0]     = 0xff;
     x02_NUD.Maximum  = new decimal(numArray5);
     x02_NUD.Name     = "x02_NUD";
     x02_NUD.Size     = new Size(40, 0x13);
     x02_NUD.TabIndex = 8;
     x04_NUD.Location = new Point(0xc0, 30);
     int[] numArray6 = new int[4];
     numArray6[0]     = 0xff;
     x04_NUD.Maximum  = new decimal(numArray6);
     x04_NUD.Name     = "x04_NUD";
     x04_NUD.Size     = new Size(40, 0x13);
     x04_NUD.TabIndex = 8;
     x01_NUD.Location = new Point(0x36, 30);
     int[] numArray7 = new int[4];
     numArray7[0]     = 0xff;
     x01_NUD.Maximum  = new decimal(numArray7);
     x01_NUD.Name     = "x01_NUD";
     x01_NUD.Size     = new Size(40, 0x13);
     x01_NUD.TabIndex = 8;
     x00_NUD.Location = new Point(8, 30);
     int[] numArray8 = new int[4];
     numArray8[0]     = 0xff;
     x00_NUD.Maximum  = new decimal(numArray8);
     x00_NUD.Name     = "x00_NUD";
     x00_NUD.Size     = new Size(40, 0x13);
     x00_NUD.TabIndex = 8;
     label8.AutoSize  = true;
     label8.Location  = new Point(0x148, 15);
     label8.Name      = "label8";
     label8.Size      = new Size(0x35, 12);
     label8.TabIndex  = 7;
     label8.Text      = "Item*";
     label7.AutoSize  = true;
     label7.Location  = new Point(0x11a, 15);
     label7.Name      = "label7";
     label7.Size      = new Size(0x25, 12);
     label7.TabIndex  = 6;
     label7.Text      = "Fish*";
     label6.AutoSize  = true;
     label6.Location  = new Point(0xec, 15);
     label6.Name      = "label6";
     label6.Size      = new Size(0x19, 12);
     label6.TabIndex  = 5;
     label6.Text      = "Fish";
     label5.AutoSize  = true;
     label5.Location  = new Point(190, 15);
     label5.Name      = "label5";
     label5.Size      = new Size(0x1d, 12);
     label5.TabIndex  = 4;
     label5.Text      = "Surf*";
     label4.AutoSize  = true;
     label4.Location  = new Point(0x90, 15);
     label4.Name      = "label4";
     label4.Size      = new Size(0x1d, 12);
     label4.TabIndex  = 3;
     label4.Text      = "Surf";
     label3.AutoSize  = true;
     label3.Location  = new Point(100, 15);
     label3.Name      = "label3";
     label3.Size      = new Size(0x1d, 12);
     label3.TabIndex  = 2;
     label3.Text      = "Shake";
     label2.AutoSize  = true;
     label2.Location  = new Point(0x34, 15);
     label2.Name      = "label2";
     label2.Size      = new Size(0x1d, 12);
     label2.TabIndex  = 1;
     label2.Text      = "Double";
     label1.AutoSize  = true;
     label1.Location  = new Point(6, 15);
     label1.Name      = "label1";
     label1.Size      = new Size(0x23, 12);
     label1.TabIndex  = 0;
     label1.Text      = "Regular";
     groupBox1.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
     groupBox1.Controls.Add(maxLvButton);
     groupBox1.Controls.Add(minLvButton);
     groupBox1.Controls.Add(pokeButton);
     groupBox1.Controls.Add(dgv);
     groupBox1.Location   = new Point(3, 3);
     groupBox1.Name       = "groupBox1";
     groupBox1.Size       = new Size(0x250, 0x1c0);
     groupBox1.TabIndex   = 0;
     groupBox1.TabStop    = false;
     groupBox1.Text       = "Encounter Slot Data";
     maxLvButton.Anchor   = AnchorStyles.Right | AnchorStyles.Bottom;
     maxLvButton.Location = new Point(0x1ed, 0x1a3);
     maxLvButton.Name     = "maxLvButton";
     maxLvButton.Size     = new Size(90, 0x17);
     maxLvButton.TabIndex = 3;
     maxLvButton.Text     = "Edit Max Level";
     maxLvButton.UseVisualStyleBackColor = true;
     maxLvButton.Click   += maxLvButton_Click;
     minLvButton.Anchor   = AnchorStyles.Right | AnchorStyles.Bottom;
     minLvButton.Location = new Point(0x18d, 0x1a3);
     minLvButton.Name     = "minLvButton";
     minLvButton.Size     = new Size(90, 0x17);
     minLvButton.TabIndex = 2;
     minLvButton.Text     = "Edit Min Level";
     minLvButton.UseVisualStyleBackColor = true;
     minLvButton.Click  += minLvButton_Click;
     pokeButton.Anchor   = AnchorStyles.Right | AnchorStyles.Bottom;
     pokeButton.Location = new Point(0x12d, 0x1a3);
     pokeButton.Name     = "pokeButton";
     pokeButton.Size     = new Size(90, 0x17);
     pokeButton.TabIndex = 1;
     pokeButton.Text     = "Edit Pokémon";
     pokeButton.UseVisualStyleBackColor = true;
     pokeButton.Click            += pokeButton_Click;
     dgv.AllowUserToAddRows       = false;
     dgv.AllowUserToDeleteRows    = false;
     dgv.AllowUserToResizeColumns = false;
     dgv.AllowUserToResizeRows    = false;
     dgv.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
     dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     dgv.Columns.AddRange(Column1, Column2, Column3, Column4);
     dgv.Location                         = new Point(3, 15);
     dgv.Name                             = "dgv";
     dgv.ReadOnly                         = true;
     dgv.RowHeadersVisible                = false;
     dgv.RowTemplate.Height               = 0x15;
     dgv.SelectionMode                    = DataGridViewSelectionMode.FullRowSelect;
     dgv.Size                             = new Size(0x24a, 0x18e);
     dgv.TabIndex                         = 0;
     Column1.AutoSizeMode                 = DataGridViewAutoSizeColumnMode.Fill;
     Column1.HeaderText                   = "Slot";
     Column1.Name                         = "Column1";
     Column1.ReadOnly                     = true;
     Column1.Resizable                    = DataGridViewTriState.False;
     Column1.SortMode                     = DataGridViewColumnSortMode.NotSortable;
     Column2.AutoSizeMode                 = DataGridViewAutoSizeColumnMode.Fill;
     Column2.HeaderText                   = "Pokémon";
     Column2.Name                         = "Column2";
     Column2.ReadOnly                     = true;
     Column2.Resizable                    = DataGridViewTriState.False;
     Column2.SortMode                     = DataGridViewColumnSortMode.NotSortable;
     Column3.HeaderText                   = "Min Level";
     Column3.Name                         = "Column3";
     Column3.ReadOnly                     = true;
     Column3.Resizable                    = DataGridViewTriState.False;
     Column3.SortMode                     = DataGridViewColumnSortMode.NotSortable;
     Column3.Width                        = 80;
     Column4.HeaderText                   = "Max Level";
     Column4.Name                         = "Column4";
     Column4.ReadOnly                     = true;
     Column4.Resizable                    = DataGridViewTriState.False;
     Column4.SortMode                     = DataGridViewColumnSortMode.NotSortable;
     Column4.Width                        = 80;
     okButton.Anchor                      = AnchorStyles.Right | AnchorStyles.Bottom;
     okButton.Location                    = new Point(0x268, 0x210);
     okButton.Name                        = "okButton";
     okButton.Size                        = new Size(0x4b, 0x17);
     okButton.TabIndex                    = 1;
     okButton.Text                        = "OK";
     okButton.UseVisualStyleBackColor     = true;
     okButton.Click                      += okButton_Click;
     cancelButton.Anchor                  = AnchorStyles.Right | AnchorStyles.Bottom;
     cancelButton.Location                = new Point(0x2b9, 0x210);
     cancelButton.Name                    = "cancelButton";
     cancelButton.Size                    = new Size(0x4b, 0x17);
     cancelButton.TabIndex                = 2;
     cancelButton.Text                    = "Cancel";
     cancelButton.UseVisualStyleBackColor = true;
     cancelButton.Click                  += cancelButton_Click;
     ofd.Filter                           = "Encounter Slot File|*.bin|All Files|*.*";
     sfd.Filter                           = "Encounter Slot File|*.bin|Slots|*.*";
     AutoScaleDimensions                  = new SizeF(6f, 12f);
     AutoScaleMode                        = AutoScaleMode.Font;
     ClientSize                           = new Size(0x310, 0x233);
     Controls.Add(cancelButton);
     Controls.Add(okButton);
     Controls.Add(panel1);
     MinimumSize   = new Size(800, 600);
     Name          = "PlaceForm";
     SizeGripStyle = SizeGripStyle.Hide;
     StartPosition = FormStartPosition.CenterParent;
     Text          = "Encounter Slot Editor";
     panel1.ResumeLayout(false);
     splitContainer1.Panel1.ResumeLayout(false);
     splitContainer1.Panel2.ResumeLayout(false);
     splitContainer1.ResumeLayout(false);
     groupBox3.ResumeLayout(false);
     groupBox2.ResumeLayout(false);
     groupBox2.PerformLayout();
     x07_NUD.EndInit();
     x06_NUD.EndInit();
     x03_NUD.EndInit();
     x05_NUD.EndInit();
     x02_NUD.EndInit();
     x04_NUD.EndInit();
     x01_NUD.EndInit();
     x00_NUD.EndInit();
     groupBox1.ResumeLayout(false);
     ((ISupportInitialize)dgv).EndInit();
     ResumeLayout(false);
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public Strategy_Properties()
        {
            pnlAveraging  = new Fancy_Panel(Language.T("Handling of Additional Entry Signals"), LayoutColors.ColorSlotCaptionBackAveraging, LayoutColors.ColorSlotCaptionText);
            pnlAmounts    = new Fancy_Panel(Language.T("Trading Size"), LayoutColors.ColorSlotCaptionBackAveraging, LayoutColors.ColorSlotCaptionText);
            pnlProtection = new Fancy_Panel(Language.T("Permanent Protection"), LayoutColors.ColorSlotCaptionBackAveraging, LayoutColors.ColorSlotCaptionText);

            lblPercent1 = new Label();
            lblPercent2 = new Label();
            lblPercent3 = new Label();

            lblAveragingSameDir = new Label();
            lblAveragingOppDir  = new Label();

            cbxSameDirAction = new ComboBox();
            cbxOppDirAction  = new ComboBox();
            nudMaxOpenLots   = new NumericUpDown();
            rbConstantUnits  = new RadioButton();
            rbVariableUnits  = new RadioButton();
            nudEntryLots     = new NumericUpDown();
            nudAddingLots    = new NumericUpDown();
            nudReducingLots  = new NumericUpDown();
            lblMaxOpenLots   = new Label();
            lblEntryLots     = new Label();
            lblAddingLots    = new Label();
            lblReducingLots  = new Label();

            chbPermaSL     = new CheckBox();
            cbxPermaSLType = new ComboBox();
            nudPermaSL     = new NumericUpDown();
            chbPermaTP     = new CheckBox();
            cbxPermaTPType = new ComboBox();
            nudPermaTP     = new NumericUpDown();
            chbBreakEven   = new CheckBox();
            nudBreakEven   = new NumericUpDown();

            btnDefault = new Button();
            btnCancel  = new Button();
            btnAccept  = new Button();

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

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = btnAccept;
            Text            = Language.T("Strategy Properties");

            // pnlAveraging
            pnlAveraging.Parent = this;

            // pnlAmounts
            pnlAmounts.Parent = this;

            // pnlProtection
            pnlProtection.Parent = this;

            // Label Same dir action
            lblAveragingSameDir.Parent    = pnlAveraging;
            lblAveragingSameDir.ForeColor = colorText;
            lblAveragingSameDir.BackColor = Color.Transparent;
            lblAveragingSameDir.AutoSize  = true;
            lblAveragingSameDir.Text      = Language.T("Next same direction signal behaviour");

            // Label Opposite dir action
            lblAveragingOppDir.Parent    = pnlAveraging;
            lblAveragingOppDir.ForeColor = colorText;
            lblAveragingOppDir.BackColor = Color.Transparent;
            lblAveragingOppDir.AutoSize  = true;
            lblAveragingOppDir.Text      = Language.T("Next opposite direction signal behaviour");

            // ComboBox SameDirAction
            cbxSameDirAction.Parent        = pnlAveraging;
            cbxSameDirAction.Name          = "cbxSameDirAction";
            cbxSameDirAction.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxSameDirAction.Items.AddRange(new string[] { Language.T("Nothing"), Language.T("Winner"), Language.T("Add") });
            cbxSameDirAction.SelectedIndex = 0;
            toolTip.SetToolTip(cbxSameDirAction,
                               Language.T("Nothing - cancels the additional orders.") + Environment.NewLine +
                               Language.T("Winner - adds to a winning position.") + Environment.NewLine +
                               Language.T("Add - adds to all positions."));

            // ComboBox OppDirAction
            cbxOppDirAction.Parent        = pnlAveraging;
            cbxOppDirAction.Name          = "cbxOppDirAction";
            cbxOppDirAction.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxOppDirAction.Items.AddRange(new string[] { 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 = colorText;
            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)dMaxOpenLots;
            nudMaxOpenLots.DecimalPlaces = 2;
            nudMaxOpenLots.TextAlign     = HorizontalAlignment.Center;
            nudMaxOpenLots.EndInit();

            // Radio Button Constant Units
            rbConstantUnits.Parent    = pnlAmounts;
            rbConstantUnits.ForeColor = colorText;
            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 = colorText;
            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 = colorText;
            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;
            nudEntryLots.Increment     = 0.01M;
            nudEntryLots.Value         = (decimal)dEntryLots;
            nudEntryLots.DecimalPlaces = 2;
            nudEntryLots.TextAlign     = HorizontalAlignment.Center;
            nudEntryLots.EndInit();

            // Label Entry Lots %
            lblPercent1.Parent    = pnlAmounts;
            lblPercent1.ForeColor = colorText;
            lblPercent1.BackColor = Color.Transparent;
            lblPercent1.AutoSize  = true;
            lblPercent1.Text      = "%";

            // Label Adding Lots
            lblAddingLots.Parent    = pnlAmounts;
            lblAddingLots.ForeColor = colorText;
            lblAddingLots.BackColor = Color.Transparent;
            lblAddingLots.AutoSize  = true;
            lblAddingLots.Text      = Language.T("In case of addition - number of lots to add");

            // NumericUpDown Adding Lots
            nudAddingLots.Parent = pnlAmounts;
            nudAddingLots.Name   = "nudAddingLots";
            nudAddingLots.BeginInit();
            nudAddingLots.Minimum       = 0.01M;
            nudAddingLots.Maximum       = 100;
            nudAddingLots.Increment     = 0.01M;
            nudAddingLots.Value         = (decimal)dAddingLots;
            nudAddingLots.DecimalPlaces = 2;
            nudAddingLots.TextAlign     = HorizontalAlignment.Center;
            nudAddingLots.EndInit();

            // Label Adding Lots %
            lblPercent2.Parent    = pnlAmounts;
            lblPercent2.ForeColor = colorText;
            lblPercent2.BackColor = Color.Transparent;
            lblPercent2.AutoSize  = true;
            lblPercent2.Text      = "%";

            // Label Reducing Lots
            lblReducingLots.Parent    = pnlAmounts;
            lblReducingLots.ForeColor = colorText;
            lblReducingLots.BackColor = Color.Transparent;
            lblReducingLots.AutoSize  = true;
            lblReducingLots.Text      = Language.T("In case of reduction - number of lots to close");

            // NumericUpDown Reducing Lots
            nudReducingLots.Parent = pnlAmounts;
            nudReducingLots.Name   = "nudReducingLots";
            nudReducingLots.BeginInit();
            nudReducingLots.Minimum       = 0.01M;
            nudReducingLots.Maximum       = 100;
            nudReducingLots.Increment     = 0.01M;
            nudReducingLots.Value         = (decimal)dReducingLots;
            nudReducingLots.DecimalPlaces = 2;
            nudReducingLots.TextAlign     = HorizontalAlignment.Center;
            nudReducingLots.EndInit();

            // Label Reducing Lots %
            lblPercent3.Parent    = pnlAmounts;
            lblPercent3.ForeColor = colorText;
            lblPercent3.BackColor = Color.Transparent;
            lblPercent3.AutoSize  = true;
            lblPercent3.Text      = "%";

            // CheckBox Permanent Stop Loss
            chbPermaSL.Parent    = pnlProtection;
            chbPermaSL.ForeColor = colorText;
            chbPermaSL.BackColor = Color.Transparent;
            chbPermaSL.AutoCheck = true;
            chbPermaSL.AutoSize  = true;
            chbPermaSL.Name      = "chbPermaSL";
            chbPermaSL.Text      = Language.T("Permanent Stop Loss");

            // ComboBox cbxPermaSLType
            cbxPermaSLType.Parent        = pnlProtection;
            cbxPermaSLType.Name          = "cbxPermaSLType";
            cbxPermaSLType.Visible       = false;
            cbxPermaSLType.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPermaSLType.Items.AddRange(new string[] { Language.T("Relative"), Language.T("Absolute") });
            cbxPermaSLType.SelectedIndex = 0;

            // NumericUpDown Permanent S/L
            nudPermaSL.Parent = pnlProtection;
            nudPermaSL.Name   = "nudPermaSL";
            nudPermaSL.BeginInit();
            nudPermaSL.Minimum   = 5;
            nudPermaSL.Maximum   = 5000;
            nudPermaSL.Increment = 1;
            nudPermaSL.Value     = iPermSL;
            nudPermaSL.TextAlign = HorizontalAlignment.Center;
            nudPermaSL.EndInit();

            // CheckBox Permanent Take Profit
            chbPermaTP.Parent    = pnlProtection;
            chbPermaTP.ForeColor = colorText;
            chbPermaTP.BackColor = Color.Transparent;
            chbPermaTP.AutoCheck = true;
            chbPermaTP.AutoSize  = true;
            chbPermaTP.Name      = "chbPermaTP";
            chbPermaTP.Text      = Language.T("Permanent Take Profit");

            // ComboBox cbxPermaTPType
            cbxPermaTPType.Parent        = pnlProtection;
            cbxPermaTPType.Name          = "cbxPermaTPType";
            cbxPermaTPType.Visible       = false;
            cbxPermaTPType.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxPermaTPType.Items.AddRange(new string[] { Language.T("Relative"), Language.T("Absolute") });
            cbxPermaTPType.SelectedIndex = 0;

            // NumericUpDown Permanent Take Profit
            nudPermaTP.Parent = pnlProtection;
            nudPermaTP.Name   = "nudPermaTP";
            nudPermaTP.BeginInit();
            nudPermaTP.Minimum   = 5;
            nudPermaTP.Maximum   = 5000;
            nudPermaTP.Increment = 1;
            nudPermaTP.Value     = iPermTP;
            nudPermaTP.TextAlign = HorizontalAlignment.Center;
            nudPermaTP.EndInit();

            // CheckBox Break Even
            chbBreakEven.Parent    = pnlProtection;
            chbBreakEven.ForeColor = colorText;
            chbBreakEven.BackColor = Color.Transparent;
            chbBreakEven.AutoCheck = true;
            chbBreakEven.AutoSize  = true;
            chbBreakEven.Name      = "chbBreakEven";
            chbBreakEven.Text      = Language.T("Break Even") + " [" + Language.T("pips") + "]";

            // NumericUpDown Break Even
            nudBreakEven.Parent = pnlProtection;
            nudBreakEven.Name   = "nudBreakEven";
            nudBreakEven.BeginInit();
            nudBreakEven.Minimum   = 5;
            nudBreakEven.Maximum   = 5000;
            nudBreakEven.Increment = 1;
            nudBreakEven.Value     = iBreakEven;
            nudBreakEven.TextAlign = HorizontalAlignment.Center;
            nudBreakEven.EndInit();

            //Button Default
            btnDefault.Parent = this;
            btnDefault.Name   = "Default";
            btnDefault.Text   = Language.T("Default");
            btnDefault.Click += new EventHandler(BtnDefault_Click);
            btnDefault.UseVisualStyleBackColor = true;

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

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

            return;
        }
Exemplo n.º 20
0
        public StrategyProperties()
        {
            PermanentTP     = 100;
            PermanentTPType = PermanentProtectionType.Relative;
            UsePermanentTP  = false;
            BreakEven       = 100;
            UseBreakEven    = false;
            PermanentSL     = 100;
            PermanentSLType = PermanentProtectionType.Relative;
            UsePermanentSL  = false;
            PnlAveraging    = new FancyPanel(Language.T("Handling of Additional Entry Signals"),
                                             LayoutColors.ColorSlotCaptionBackAveraging, LayoutColors.ColorSlotCaptionText);
            PnlAmounts = new FancyPanel(Language.T("Trading Size"), LayoutColors.ColorSlotCaptionBackAveraging,
                                        LayoutColors.ColorSlotCaptionText);
            PnlProtection = new FancyPanel(Language.T("Permanent Protection"),
                                           LayoutColors.ColorSlotCaptionBackAveraging,
                                           LayoutColors.ColorSlotCaptionText);

            LblPercent1 = new Label();
            LblPercent2 = new Label();
            LblPercent3 = new Label();

            LblAveragingSameDir = new Label();
            LblAveragingOppDir  = new Label();

            CbxSameDirAction = new ComboBox();
            CbxOppDirAction  = new ComboBox();
            NudMaxOpenLots   = new NumericUpDown();
            RbConstantUnits  = new RadioButton();
            RbVariableUnits  = new RadioButton();
            NudEntryLots     = new NumericUpDown();
            NudAddingLots    = new NumericUpDown();
            NudReducingLots  = new NumericUpDown();
            LblMaxOpenLots   = new Label();
            LblEntryLots     = new Label();
            LblAddingLots    = new Label();
            LblReducingLots  = new Label();

            ChbPermaSL              = new CheckBox();
            CbxPermaSLType          = new ComboBox();
            NudPermaSL              = new NumericUpDown();
            ChbPermaTP              = new CheckBox();
            CbxPermaTPType          = new ComboBox();
            NudPermaTP              = new NumericUpDown();
            ChbBreakEven            = new CheckBox();
            NudBreakEven            = new NumericUpDown();
            CbxUseMartingale        = new CheckBox();
            NudMartingaleMultiplier = new NumericUpDown();


            BtnDefault = new Button();
            BtnCancel  = new Button();
            BtnAccept  = new Button();

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = BtnAccept;
            Text            = Language.T("Strategy Properties");

            // pnlAveraging
            PnlAveraging.Parent = this;

            // pnlAmounts
            PnlAmounts.Parent = this;

            // pnlProtection
            PnlProtection.Parent = this;

            // Label Same dir action
            LblAveragingSameDir.Parent    = PnlAveraging;
            LblAveragingSameDir.ForeColor = LayoutColors.ColorControlText;
            LblAveragingSameDir.BackColor = Color.Transparent;
            LblAveragingSameDir.AutoSize  = true;
            LblAveragingSameDir.Text      = Language.T("Next same direction signal behaviour");

            // Label Opposite dir action
            LblAveragingOppDir.Parent    = PnlAveraging;
            LblAveragingOppDir.ForeColor = LayoutColors.ColorControlText;
            LblAveragingOppDir.BackColor = Color.Transparent;
            LblAveragingOppDir.AutoSize  = true;
            LblAveragingOppDir.Text      = Language.T("Next opposite direction signal behaviour");

            // ComboBox SameDirAction
            CbxSameDirAction.Parent        = PnlAveraging;
            CbxSameDirAction.Name          = "cbxSameDirAction";
            CbxSameDirAction.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxSameDirAction.Items.AddRange(new object[]
                                            { Language.T("Nothing"), Language.T("Winner"), Language.T("Add") });
            CbxSameDirAction.SelectedIndex = 0;
            toolTip.SetToolTip(CbxSameDirAction,
                               Language.T("Nothing - cancels the additional orders.") + Environment.NewLine +
                               Language.T("Winner - adds to a winning position.") + Environment.NewLine +
                               Language.T("Add - adds to all positions."));

            // 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;
            NudEntryLots.Increment     = 0.01M;
            NudEntryLots.Value         = (decimal)EntryLots;
            NudEntryLots.DecimalPlaces = 2;
            NudEntryLots.TextAlign     = HorizontalAlignment.Center;
            NudEntryLots.EndInit();

            // Label Entry Lots %
            LblPercent1.Parent    = PnlAmounts;
            LblPercent1.ForeColor = LayoutColors.ColorControlText;
            LblPercent1.BackColor = Color.Transparent;
            LblPercent1.AutoSize  = true;
            LblPercent1.Text      = "%";

            // Label Adding Lots
            LblAddingLots.Parent    = PnlAmounts;
            LblAddingLots.ForeColor = LayoutColors.ColorControlText;
            LblAddingLots.BackColor = Color.Transparent;
            LblAddingLots.AutoSize  = true;
            LblAddingLots.Text      = Language.T("In case of addition - number of lots to add");

            // NumericUpDown Adding Lots
            NudAddingLots.Parent = PnlAmounts;
            NudAddingLots.Name   = "nudAddingLots";
            NudAddingLots.BeginInit();
            NudAddingLots.Minimum       = 0.01M;
            NudAddingLots.Maximum       = 100;
            NudAddingLots.Increment     = 0.01M;
            NudAddingLots.Value         = (decimal)AddingLots;
            NudAddingLots.DecimalPlaces = 2;
            NudAddingLots.TextAlign     = HorizontalAlignment.Center;
            NudAddingLots.EndInit();

            // Label Adding Lots %
            LblPercent2.Parent    = PnlAmounts;
            LblPercent2.ForeColor = LayoutColors.ColorControlText;
            LblPercent2.BackColor = Color.Transparent;
            LblPercent2.AutoSize  = true;
            LblPercent2.Text      = "%";

            // Label Reducing Lots
            LblReducingLots.Parent    = PnlAmounts;
            LblReducingLots.ForeColor = LayoutColors.ColorControlText;
            LblReducingLots.BackColor = Color.Transparent;
            LblReducingLots.AutoSize  = true;
            LblReducingLots.Text      = Language.T("In case of reduction - number of lots to close");

            // NumericUpDown Reducing Lots
            NudReducingLots.Parent = PnlAmounts;
            NudReducingLots.Name   = "nudReducingLots";
            NudReducingLots.BeginInit();
            NudReducingLots.Minimum       = 0.01M;
            NudReducingLots.Maximum       = 100;
            NudReducingLots.Increment     = 0.01M;
            NudReducingLots.Value         = (decimal)ReducingLots;
            NudReducingLots.DecimalPlaces = 2;
            NudReducingLots.TextAlign     = HorizontalAlignment.Center;
            NudReducingLots.EndInit();

            // Label Reducing Lots %
            LblPercent3.Parent    = PnlAmounts;
            LblPercent3.ForeColor = LayoutColors.ColorControlText;
            LblPercent3.BackColor = Color.Transparent;
            LblPercent3.AutoSize  = true;
            LblPercent3.Text      = "%";

            // CheckBox Use Martingale
            CbxUseMartingale.Name      = "cbxUseMartingale";
            CbxUseMartingale.Parent    = PnlAmounts;
            CbxUseMartingale.ForeColor = LayoutColors.ColorControlText;
            CbxUseMartingale.BackColor = Color.Transparent;
            CbxUseMartingale.AutoCheck = true;
            CbxUseMartingale.AutoSize  = true;
            CbxUseMartingale.Checked   = false;
            CbxUseMartingale.Text      = Language.T("Martingale money management multiplier");

            // NumericUpDown Martingale Multiplier
            NudMartingaleMultiplier.Parent = PnlAmounts;
            NudMartingaleMultiplier.Name   = "nudMartingaleMultiplier";
            NudMartingaleMultiplier.BeginInit();
            NudMartingaleMultiplier.Minimum       = 0.01M;
            NudMartingaleMultiplier.Maximum       = 10;
            NudMartingaleMultiplier.Increment     = 0.01m;
            NudMartingaleMultiplier.DecimalPlaces = 2;
            NudMartingaleMultiplier.Value         = 2;
            NudMartingaleMultiplier.TextAlign     = HorizontalAlignment.Center;
            NudMartingaleMultiplier.EndInit();

            // CheckBox Permanent Stop Loss
            ChbPermaSL.Parent    = PnlProtection;
            ChbPermaSL.ForeColor = LayoutColors.ColorControlText;
            ChbPermaSL.BackColor = Color.Transparent;
            ChbPermaSL.AutoCheck = true;
            ChbPermaSL.AutoSize  = true;
            ChbPermaSL.Name      = "chbPermaSL";
            ChbPermaSL.Text      = Language.T("Permanent Stop Loss");

            // ComboBox cbxPermaSLType
            CbxPermaSLType.Parent        = PnlProtection;
            CbxPermaSLType.Name          = "cbxPermaSLType";
            CbxPermaSLType.Visible       = false;
            CbxPermaSLType.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPermaSLType.Items.AddRange(new object[] { Language.T("Relative"), Language.T("Absolute") });
            CbxPermaSLType.SelectedIndex = 0;

            // NumericUpDown Permanent S/L
            NudPermaSL.Parent = PnlProtection;
            NudPermaSL.Name   = "nudPermaSL";
            NudPermaSL.BeginInit();
            NudPermaSL.Minimum   = 5;
            NudPermaSL.Maximum   = 5000;
            NudPermaSL.Increment = 1;
            NudPermaSL.Value     = PermanentSL;
            NudPermaSL.TextAlign = HorizontalAlignment.Center;
            NudPermaSL.EndInit();

            // CheckBox Permanent Take Profit
            ChbPermaTP.Parent    = PnlProtection;
            ChbPermaTP.ForeColor = LayoutColors.ColorControlText;
            ChbPermaTP.BackColor = Color.Transparent;
            ChbPermaTP.AutoCheck = true;
            ChbPermaTP.AutoSize  = true;
            ChbPermaTP.Name      = "chbPermaTP";
            ChbPermaTP.Text      = Language.T("Permanent Take Profit");

            // ComboBox cbxPermaTPType
            CbxPermaTPType.Parent        = PnlProtection;
            CbxPermaTPType.Name          = "cbxPermaTPType";
            CbxPermaTPType.Visible       = false;
            CbxPermaTPType.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPermaTPType.Items.AddRange(new object[] { Language.T("Relative"), Language.T("Absolute") });
            CbxPermaTPType.SelectedIndex = 0;

            // NumericUpDown Permanent Take Profit
            NudPermaTP.Parent = PnlProtection;
            NudPermaTP.Name   = "nudPermaTP";
            NudPermaTP.BeginInit();
            NudPermaTP.Minimum   = 5;
            NudPermaTP.Maximum   = 5000;
            NudPermaTP.Increment = 1;
            NudPermaTP.Value     = PermanentTP;
            NudPermaTP.TextAlign = HorizontalAlignment.Center;
            NudPermaTP.EndInit();

            // CheckBox Break Even
            ChbBreakEven.Parent    = PnlProtection;
            ChbBreakEven.ForeColor = LayoutColors.ColorControlText;
            ChbBreakEven.BackColor = Color.Transparent;
            ChbBreakEven.AutoCheck = true;
            ChbBreakEven.AutoSize  = true;
            ChbBreakEven.Name      = "chbBreakEven";
            ChbBreakEven.Text      = Language.T("Break Even") + " [" + Language.T("pips") + "]";

            // NumericUpDown Break Even
            NudBreakEven.Parent = PnlProtection;
            NudBreakEven.Name   = "nudBreakEven";
            NudBreakEven.BeginInit();
            NudBreakEven.Minimum   = 5;
            NudBreakEven.Maximum   = 5000;
            NudBreakEven.Increment = 1;
            NudBreakEven.Value     = BreakEven;
            NudBreakEven.TextAlign = HorizontalAlignment.Center;
            NudBreakEven.EndInit();

            //Button Default
            BtnDefault.Parent = this;
            BtnDefault.Name   = "Default";
            BtnDefault.Text   = Language.T("Default");
            BtnDefault.Click += BtnDefaultClick;
            BtnDefault.UseVisualStyleBackColor = true;

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

            //Button Accept
            BtnAccept.Parent                  = this;
            BtnAccept.Name                    = "Accept";
            BtnAccept.Text                    = Language.T("Accept");
            BtnAccept.DialogResult            = DialogResult.OK;
            BtnAccept.UseVisualStyleBackColor = true;
        }
Exemplo n.º 21
0
        private void InitializeComponent()
        {
            Color   color;
            Padding padding1;
            Point   point1;
            Size    size1;
            SizeF   sizeF1;

            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(Pumper));

            RTheme1        = new RTheme();
            RButtonRed1    = new RButtonRed();
            RButton2       = new RButton();
            TextBox8       = new TextBox();
            RButton1       = new RButton();
            RadioButton2   = new RadioButton();
            NumericUpDown9 = new NumericUpDown();
            RadioButton1   = new RadioButton();
            RTheme1.SuspendLayout();
            NumericUpDown9.BeginInit();
            SuspendLayout();
            RTheme1.BackColor = Color.FromArgb(28, 28, 28);
            RTheme1.Controls.Add(RButtonRed1);
            RTheme1.Controls.Add(RButton2);
            RTheme1.Controls.Add(TextBox8);
            RTheme1.Controls.Add(RButton1);
            RTheme1.Controls.Add(RadioButton2);
            RTheme1.Controls.Add(NumericUpDown9);
            RTheme1.Controls.Add(RadioButton1);
            RTheme1.Dock      = DockStyle.Fill;
            RTheme1.ForeColor = Color.White;
            RTheme1.Image     = null;
            Point point2 = new Point(0, 0);

            RTheme1.Location   = point2;
            RTheme1.MoveHeight = 26;
            RTheme1.Name       = "RTheme1";
            RTheme1.Resizable  = false;
            Size size2 = new Size(159, 141);

            RTheme1.Size            = size2;
            RTheme1.TabIndex        = 0;
            RTheme1.Text            = "Pumper";
            RTheme1.TransparencyKey = Color.Fuchsia;
            RButtonRed1.Image       = null;
            point2 = new Point(131, 3);
            RButtonRed1.Location   = point2;
            RButtonRed1.Name       = "RButtonRed1";
            RButtonRed1.NoRounding = false;
            size2                = new Size(23, 21);
            RButtonRed1.Size     = size2;
            RButtonRed1.TabIndex = 160;
            RButton2.Image       = null;
            point2               = new Point(12, 91);
            RButton2.Location    = point2;
            RButton2.Name        = "RButton2";
            RButton2.NoRounding  = false;
            size2                = new Size(135, 39);
            RButton2.Size        = size2;
            RButton2.TabIndex    = 159;
            RButton2.Text        = "Pump'Z";
            TextBox8.BackColor   = SystemColors.MenuText;
            TextBox8.BorderStyle = BorderStyle.FixedSingle;
            TextBox8.Font        = new Font("Calibri", 8.75F, FontStyle.Bold);
            TextBox8.ForeColor   = Color.Tomato;
            point2               = new Point(13, 39);
            TextBox8.Location    = point2;
            Padding padding2 = new Padding(4, 3, 4, 3);

            TextBox8.Margin    = padding2;
            TextBox8.Multiline = true;
            TextBox8.Name      = "TextBox8";
            TextBox8.ReadOnly  = true;
            size2                  = new Size(68, 19);
            TextBox8.Size          = size2;
            TextBox8.TabIndex      = 158;
            TextBox8.Text          = "Select File";
            RButton1.Image         = null;
            point2                 = new Point(88, 38);
            RButton1.Location      = point2;
            RButton1.Name          = "RButton1";
            RButton1.NoRounding    = false;
            size2                  = new Size(59, 21);
            RButton1.Size          = size2;
            RButton1.TabIndex      = 0;
            RButton1.Text          = "*.exe";
            RadioButton2.AutoSize  = true;
            RadioButton2.ForeColor = Color.FromArgb(100, 100, 100);
            point2                 = new Point(58, 65);
            RadioButton2.Location  = point2;
            RadioButton2.Name      = "RadioButton2";
            size2                  = new Size(41, 17);
            RadioButton2.Size      = size2;
            RadioButton2.TabIndex  = 24;
            RadioButton2.Text      = "MB";
            RadioButton2.UseVisualStyleBackColor = true;
            NumericUpDown9.BackColor             = Color.Black;
            NumericUpDown9.BorderStyle           = BorderStyle.FixedSingle;
            NumericUpDown9.ForeColor             = Color.Transparent;
            point2 = new Point(104, 65);
            NumericUpDown9.Location = point2;
            int[]   iArr = new int[] { 1, 0, 0, 0 };
            decimal dec  = new Decimal(iArr);

            NumericUpDown9.Minimum = dec;
            NumericUpDown9.Name    = "NumericUpDown9";
            size2 = new Size(42, 20);
            NumericUpDown9.Size     = size2;
            NumericUpDown9.TabIndex = 22;
            iArr = new int[] { 1, 0, 0, 0 };
            dec  = new Decimal(iArr);
            NumericUpDown9.Value    = dec;
            RadioButton1.AutoSize   = true;
            RadioButton1.CheckAlign = ContentAlignment.TopLeft;
            RadioButton1.Checked    = true;
            RadioButton1.ForeColor  = Color.FromArgb(100, 100, 100);
            point2 = new Point(13, 65);
            RadioButton1.Location = point2;
            RadioButton1.Name     = "RadioButton1";
            size2                 = new Size(39, 17);
            RadioButton1.Size     = size2;
            RadioButton1.TabIndex = 23;
            RadioButton1.TabStop  = true;
            RadioButton1.Text     = "KB";
            RadioButton1.UseVisualStyleBackColor = true;
            SizeF sizeF2 = new SizeF(6.0F, 13.0F);

            AutoScaleDimensions = sizeF2;
            AutoScaleMode       = AutoScaleMode.Font;
            size2      = new Size(159, 141);
            ClientSize = size2;
            Controls.Add(RTheme1);
            FormBorderStyle = FormBorderStyle.None;
            Icon            = (Icon)componentResourceManager.GetObject("$this.Icon");
            Name            = "Pumper";
            StartPosition   = FormStartPosition.CenterScreen;
            Text            = "Pumper";
            TopMost         = true;
            TransparencyKey = Color.Fuchsia;
            RTheme1.ResumeLayout(false);
            RTheme1.PerformLayout();
            NumericUpDown9.EndInit();
            ResumeLayout(false);
        }
Exemplo n.º 22
0
 private void InitializeComponent()
 {
     numericUpDown1       = new NumericUpDown();
     numericUpDown2       = new NumericUpDown();
     numericUpDown3       = new NumericUpDown();
     numericUpDown4       = new NumericUpDown();
     numericUpDown5       = new NumericUpDown();
     numericUpDown6       = new NumericUpDown();
     richTextBox1         = new RichTextBox();
     numericUpDown7       = new NumericUpDown();
     numericUpDown8       = new NumericUpDown();
     listBox1             = new ListBox();
     checkBox1            = new CheckBox();
     folderBrowserDialog1 = new FolderBrowserDialog();
     treeView1            = new TreeView();
     numericUpDown1.BeginInit();
     numericUpDown2.BeginInit();
     numericUpDown3.BeginInit();
     numericUpDown4.BeginInit();
     numericUpDown5.BeginInit();
     numericUpDown6.BeginInit();
     numericUpDown7.BeginInit();
     numericUpDown8.BeginInit();
     SuspendLayout();
     numericUpDown1.Location = new Point(0, 0);
     numericUpDown1.Maximum  = new Decimal(new int[4] {
         byte.MaxValue, 0, 0, 0
     });
     numericUpDown1.Name      = "numericUpDown1";
     numericUpDown1.Size      = new Size(128, 21);
     numericUpDown1.TabIndex  = 0;
     numericUpDown1.TextAlign = HorizontalAlignment.Center;
     numericUpDown2.Location  = new Point(0, 22);
     numericUpDown2.Maximum   = new Decimal(new int[4] {
         byte.MaxValue, 0, 0, 0
     });
     numericUpDown2.Name      = "numericUpDown2";
     numericUpDown2.Size      = new Size(128, 21);
     numericUpDown2.TabIndex  = 1;
     numericUpDown2.TextAlign = HorizontalAlignment.Center;
     numericUpDown3.Location  = new Point(0, 44);
     numericUpDown3.Maximum   = new Decimal(new int[4] {
         byte.MaxValue, 0, 0, 0
     });
     numericUpDown3.Name      = "numericUpDown3";
     numericUpDown3.Size      = new Size(128, 21);
     numericUpDown3.TabIndex  = 2;
     numericUpDown3.TextAlign = HorizontalAlignment.Center;
     numericUpDown4.Increment = new Decimal(new int[4] {
         500, 0, 0, 0
     });
     numericUpDown4.Location = new Point(0, 73);
     numericUpDown4.Maximum  = new Decimal(new int[4] {
         100000, 0, 0, 0
     });
     numericUpDown4.Name      = "numericUpDown4";
     numericUpDown4.Size      = new Size(128, 21);
     numericUpDown4.TabIndex  = 3;
     numericUpDown4.TextAlign = HorizontalAlignment.Center;
     numericUpDown5.Increment = new Decimal(new int[4] {
         10, 0, 0, 0
     });
     numericUpDown5.Location = new Point(0, 94);
     numericUpDown5.Maximum  = new Decimal(new int[4] {
         10000, 0, 0, 0
     });
     numericUpDown5.Name      = "numericUpDown5";
     numericUpDown5.Size      = new Size(128, 21);
     numericUpDown5.TabIndex  = 4;
     numericUpDown5.TextAlign = HorizontalAlignment.Center;
     numericUpDown6.Increment = new Decimal(new int[4] {
         10, 0, 0, 0
     });
     numericUpDown6.Location = new Point(0, 115);
     numericUpDown6.Maximum  = new Decimal(new int[4] {
         10000, 0, 0, 0
     });
     numericUpDown6.Name      = "numericUpDown6";
     numericUpDown6.Size      = new Size(128, 21);
     numericUpDown6.TabIndex  = 5;
     numericUpDown6.TextAlign = HorizontalAlignment.Center;
     richTextBox1.Anchor      = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
     richTextBox1.Location    = new Point(0, 209);
     richTextBox1.Name        = "richTextBox1";
     richTextBox1.Size        = new Size(128, 272);
     richTextBox1.TabIndex    = 8;
     richTextBox1.Text        = "";
     numericUpDown7.Increment = new Decimal(new int[4] {
         10, 0, 0, 0
     });
     numericUpDown7.Location = new Point(0, 136);
     numericUpDown7.Maximum  = new Decimal(new int[4] {
         10000, 0, 0, 0
     });
     numericUpDown7.Name      = "numericUpDown7";
     numericUpDown7.Size      = new Size(128, 21);
     numericUpDown7.TabIndex  = 6;
     numericUpDown7.TextAlign = HorizontalAlignment.Center;
     numericUpDown8.Increment = new Decimal(new int[4] {
         100, 0, 0, 0
     });
     numericUpDown8.Location = new Point(0, 157);
     numericUpDown8.Maximum  = new Decimal(new int[4] {
         10000, 0, 0, 0
     });
     numericUpDown8.Name          = "numericUpDown8";
     numericUpDown8.Size          = new Size(128, 21);
     numericUpDown8.TabIndex      = 7;
     numericUpDown8.TextAlign     = HorizontalAlignment.Center;
     listBox1.Anchor              = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
     listBox1.FormattingEnabled   = true;
     listBox1.HorizontalScrollbar = true;
     listBox1.ItemHeight          = 12;
     listBox1.Location            = new Point(134, 0);
     listBox1.Name         = "listBox1";
     listBox1.Size         = new Size(183, 196);
     listBox1.TabIndex     = 9;
     listBox1.DoubleClick += new EventHandler(listBox1_DoubleClick);
     checkBox1.AutoSize    = true;
     checkBox1.Location    = new Point(0, 187);
     checkBox1.Name        = "checkBox1";
     checkBox1.Size        = new Size(96, 16);
     checkBox1.TabIndex    = 10;
     checkBox1.Text        = "显示判定范围";
     checkBox1.UseVisualStyleBackColor = true;
     treeView1.Anchor    = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
     treeView1.Location  = new Point(134, 209);
     treeView1.Name      = "treeView1";
     treeView1.Size      = new Size(183, 272);
     treeView1.TabIndex  = 11;
     AutoScaleDimensions = new SizeF(6f, 12f);
     AutoScaleMode       = AutoScaleMode.Font;
     ClientSize          = new Size(318, 480);
     Controls.Add(treeView1);
     Controls.Add(checkBox1);
     Controls.Add(listBox1);
     Controls.Add(numericUpDown8);
     Controls.Add(numericUpDown7);
     Controls.Add(richTextBox1);
     Controls.Add(numericUpDown4);
     Controls.Add(numericUpDown5);
     Controls.Add(numericUpDown6);
     Controls.Add(numericUpDown3);
     Controls.Add(numericUpDown2);
     Controls.Add(numericUpDown1);
     Name          = nameof(Form_Test);
     StartPosition = FormStartPosition.CenterScreen;
     Text          = "Test";
     Load         += new EventHandler(Form_Test_Load);
     numericUpDown1.EndInit();
     numericUpDown2.EndInit();
     numericUpDown3.EndInit();
     numericUpDown4.EndInit();
     numericUpDown5.EndInit();
     numericUpDown6.EndInit();
     numericUpDown7.EndInit();
     numericUpDown8.EndInit();
     ResumeLayout(false);
     PerformLayout();
 }
Exemplo n.º 23
0
        public void SetCriteriaPanel()
        {
            chbAmbiguousBars = new CheckBox
            {
                Parent    = this,
                ForeColor = ForeColor,
                BackColor = Color.Transparent,
                Text      = Language.T("Maximum number of ambiguous bars"),
                Checked   = true,
                AutoSize  = true
            };

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

            chbMinProfitPerDay = new CheckBox
            {
                Parent    = this,
                ForeColor = ForeColor,
                BackColor = Color.Transparent,
                Text      = Language.T("Minimum Profit Per Day") + " [" + Configs.AccountCurrency + "]",
                Checked   = true,
                AutoSize  = true
            };

            nudMinProfitPerDay = new NumericUpDown {
                Parent = this, TextAlign = HorizontalAlignment.Center
            };
            nudMinProfitPerDay.BeginInit();
            nudMinProfitPerDay.Minimum   = 1;
            nudMinProfitPerDay.Maximum   = 500;
            nudMinProfitPerDay.Increment = 1;
            nudMinProfitPerDay.Value     = 1;
            nudMinProfitPerDay.EndInit();

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

            nudMaxDrawdown = new NumericUpDown {
                Parent = this, TextAlign = HorizontalAlignment.Center
            };
            nudMaxDrawdown.BeginInit();
            nudMaxDrawdown.Minimum   = 0;
            nudMaxDrawdown.Maximum   = Configs.InitialAccount;
            nudMaxDrawdown.Increment = 10;
            nudMaxDrawdown.Value     = (decimal)Math.Round(Configs.InitialAccount / 4.0);
            nudMaxDrawdown.EndInit();

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

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

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

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

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

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

            chbWinLossRatio = new CheckBox
            {
                Parent    = this,
                ForeColor = ForeColor,
                BackColor = Color.Transparent,
                Text      = Language.T("Minimum win / loss trades ratio"),
                Checked   = false,
                AutoSize  = true
            };

            nudWinLossRatio = new NumericUpDown {
                Parent = this, TextAlign = HorizontalAlignment.Center
            };
            nudWinLossRatio.BeginInit();
            nudWinLossRatio.Minimum       = 0.10M;
            nudWinLossRatio.Maximum       = 1;
            nudWinLossRatio.Increment     = 0.01M;
            nudWinLossRatio.Value         = 0.30M;
            nudWinLossRatio.DecimalPlaces = 2;
            nudWinLossRatio.EndInit();

            chbMinSharpeRatio = new CheckBox
            {
                Parent    = this,
                ForeColor = ForeColor,
                BackColor = Color.Transparent,
                Text      = Language.T("Minimum Sharpe ratio"),
                Checked   = false,
                AutoSize  = true
            };

            nudMinSharpeRatio = new NumericUpDown {
                Parent = this, TextAlign = HorizontalAlignment.Center
            };
            nudMinSharpeRatio.BeginInit();
            nudMinSharpeRatio.Minimum       = 0.1M;
            nudMinSharpeRatio.Maximum       = 10.0M;
            nudMinSharpeRatio.Increment     = 0.1M;
            nudMinSharpeRatio.Value         = 0.2M;
            nudMinSharpeRatio.DecimalPlaces = 1;
            nudMinSharpeRatio.EndInit();

            chbMaxConsecLosses = new CheckBox
            {
                Parent    = this,
                ForeColor = ForeColor,
                BackColor = Color.Transparent,
                Text      = Language.T("Max consecutive losses"),
                Checked   = false,
                AutoSize  = true
            };

            nudMaxConsecLosses = new NumericUpDown {
                Parent = this, TextAlign = HorizontalAlignment.Center
            };
            nudMaxConsecLosses.BeginInit();
            nudMaxConsecLosses.Minimum   = 1;
            nudMaxConsecLosses.Maximum   = 100;
            nudMaxConsecLosses.Increment = 1;
            nudMaxConsecLosses.Value     = 5;
            nudMaxConsecLosses.EndInit();

            chbMaxRedGreenDeviation = new CheckBox
            {
                Parent    = this,
                ForeColor = ForeColor,
                BackColor = Color.Transparent,
                Text      = Language.T("Max long/short balance deviation"),
                Checked   = false,
                AutoSize  = true
            };

            nudMaxRedGreenDeviation = new NumericUpDown {
                Parent = this, TextAlign = HorizontalAlignment.Center
            };
            nudMaxRedGreenDeviation.BeginInit();
            nudMaxRedGreenDeviation.Minimum = 1;
            nudMaxRedGreenDeviation.Maximum = 100;
            nudMaxRedGreenDeviation.Value   = 40;
            nudMaxRedGreenDeviation.EndInit();
            toolTip.SetToolTip(nudMaxRedGreenDeviation, Language.T("Deviation percent."));

            chbOOSPatternFilter = new CheckBox
            {
                Parent    = this,
                ForeColor = ForeColor,
                BackColor = Color.Transparent,
                Text      = Language.T("Filter bad OOS performance"),
                Checked   = false,
                AutoSize  = true
            };

            nudoosPatternPercent = new NumericUpDown
            {
                Parent    = this,
                TextAlign = HorizontalAlignment.Center
            };
            nudoosPatternPercent.BeginInit();
            nudoosPatternPercent.Minimum = 1;
            nudoosPatternPercent.Maximum = 50;
            nudoosPatternPercent.Value   = 20;
            nudoosPatternPercent.EndInit();
            toolTip.SetToolTip(nudoosPatternPercent, Language.T("Deviation percent."));

            chbSmoothBalanceLines = new CheckBox
            {
                Parent    = this,
                ForeColor = ForeColor,
                BackColor = Color.Transparent,
                Text      = Language.T("Filter non-linear balance pattern"),
                Checked   = false,
                AutoSize  = true
            };

            nudSmoothBalancePercent = new NumericUpDown
            {
                Parent    = this,
                TextAlign = HorizontalAlignment.Center
            };
            nudSmoothBalancePercent.BeginInit();
            nudSmoothBalancePercent.Minimum = 1;
            nudSmoothBalancePercent.Maximum = 50;
            nudSmoothBalancePercent.Value   = 20;
            nudSmoothBalancePercent.EndInit();
            toolTip.SetToolTip(nudSmoothBalancePercent, Language.T("Deviation percent."));

            nudSmoothBalanceCheckPoints = new NumericUpDown
            {
                Parent    = this,
                TextAlign = HorizontalAlignment.Center
            };
            nudSmoothBalanceCheckPoints.BeginInit();
            nudSmoothBalanceCheckPoints.Minimum = 1;
            nudSmoothBalanceCheckPoints.Maximum = 50;
            nudSmoothBalanceCheckPoints.Value   = 1;
            nudSmoothBalanceCheckPoints.EndInit();
            toolTip.SetToolTip(nudSmoothBalanceCheckPoints, Language.T("Check points count."));

            Resize += CriteriaControls_Resize;
        }
Exemplo n.º 24
0
        /// <summary>
        ///     Constructor.
        /// </summary>
        public DataHorizon(int maxBars, DateTime startTime, DateTime endTime, bool useStartTime, bool useEndTime)
        {
            MaxBars      = maxBars;
            StartTime    = startTime;
            EndTime      = endTime;
            UseEndTime   = useEndTime;
            UseStartTime = useStartTime;

            BtnAccept       = new Button();
            BtnHelp         = new Button();
            BtnCancel       = new Button();
            PnlBase         = new FancyPanel();
            DtpStartTime    = new DateTimePicker();
            DtpEndTime      = new DateTimePicker();
            CbxUseEndTime   = new CheckBox();
            CbxUseStartTime = new CheckBox();
            NudMaxBars      = new NumericUpDown();
            LblMaxBars      = new Label();
            LblMinBars      = new Label();

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = BtnAccept;
            Text            = Language.T("Data Horizon");

            var toolTip = new ToolTip();

            // Button Help
            BtnHelp.Parent = this;
            BtnHelp.Name   = "Help";
            BtnHelp.Text   = Language.T("Help");
            BtnHelp.UseVisualStyleBackColor = true;
            BtnHelp.Click += BtnHelpClick;

            // Button Accept
            BtnAccept.Parent                  = this;
            BtnAccept.Name                    = "Ok";
            BtnAccept.Text                    = Language.T("Accept");
            BtnAccept.DialogResult            = DialogResult.OK;
            BtnAccept.UseVisualStyleBackColor = true;

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

            // Panel Base
            PnlBase.Parent = this;

            // Check box UesStartTime
            CbxUseStartTime.Parent             = PnlBase;
            CbxUseStartTime.AutoSize           = true;
            CbxUseStartTime.ForeColor          = LayoutColors.ColorControlText;
            CbxUseStartTime.BackColor          = Color.Transparent;
            CbxUseStartTime.Text               = Language.T("Remove data older than:");
            CbxUseStartTime.CheckStateChanged += UseStartTimeCheckStateChanged;
            toolTip.SetToolTip(CbxUseStartTime, Language.T("All data older than the specified date will be cut out."));

            // Check box UesEndTime
            CbxUseEndTime.Parent             = PnlBase;
            CbxUseEndTime.ForeColor          = LayoutColors.ColorControlText;
            CbxUseEndTime.BackColor          = Color.Transparent;
            CbxUseEndTime.AutoSize           = true;
            CbxUseEndTime.Text               = Language.T("Remove data newer than:");
            CbxUseEndTime.CheckStateChanged += UseEndTimeCheckStateChanged;
            toolTip.SetToolTip(CbxUseEndTime, Language.T("All data newer than the specified date will be cut out."));

            // StartTime
            DtpStartTime.Parent        = PnlBase;
            DtpStartTime.ForeColor     = LayoutColors.ColorControlText;
            DtpStartTime.Format        = DateTimePickerFormat.Custom;
            DtpStartTime.CustomFormat  = "MMMM dd, yyyy - dddd,   HH : mm";
            DtpStartTime.ShowUpDown    = true;
            DtpStartTime.ValueChanged += StartTimeValueChanged;

            // EndTime
            DtpEndTime.Parent        = PnlBase;
            DtpEndTime.ForeColor     = LayoutColors.ColorControlText;
            DtpEndTime.Format        = DateTimePickerFormat.Custom;
            DtpEndTime.CustomFormat  = "MMMM dd, yyyy - dddd,   HH : mm";
            DtpEndTime.ShowUpDown    = true;
            DtpEndTime.ValueChanged += EndTimeValueChanged;

            // LabelMaxBars
            LblMaxBars.Parent    = PnlBase;
            LblMaxBars.AutoSize  = true;
            LblMaxBars.ForeColor = LayoutColors.ColorControlText;
            LblMaxBars.BackColor = Color.Transparent;
            LblMaxBars.Text      = Language.T("Maximum number of bars:");
            LblMaxBars.TextAlign = ContentAlignment.MiddleLeft;

            // MaxBars
            NudMaxBars.BeginInit();
            NudMaxBars.Parent             = PnlBase;
            NudMaxBars.Name               = "MaxBars";
            NudMaxBars.Minimum            = Configs.MinBars;
            NudMaxBars.Maximum            = Configs.MaxBarsLimit;
            NudMaxBars.ThousandsSeparator = true;
            NudMaxBars.ValueChanged      += MaxBarsValueChanged;
            NudMaxBars.TextAlign          = HorizontalAlignment.Center;
            NudMaxBars.EndInit();

            // Label MinBars
            LblMinBars.Parent    = PnlBase;
            LblMinBars.AutoSize  = true;
            LblMinBars.ForeColor = LayoutColors.ColorControlText;
            LblMinBars.BackColor = Color.Transparent;
            LblMinBars.Text      = Language.T("Minimum number of bars:") + " " + Configs.MinBars;
            LblMinBars.TextAlign = ContentAlignment.MiddleLeft;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Profit_Calculator()
        {
            pnlInput  = new Fancy_Panel(Language.T("Input Values"));
            pnlOutput = new Fancy_Panel(Language.T("Output Values"));

            alblInputNames   = new Label[6];
            alblOutputNames  = new Label[8];
            alblOutputValues = new Label[8];

            lblLotSize    = new Label();
            cbxDirection  = new ComboBox();
            nudLots       = new NumericUpDown();
            nudEntryPrice = new NumericUpDown();
            nudExitPrice  = new NumericUpDown();
            nudDays       = new NumericUpDown();

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

            MaximizeBox     = false;
            MinimizeBox     = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Text            = Language.T("Profit Calculator");

            // Input
            pnlInput.Parent = this;

            // Output
            pnlOutput.Parent = this;

            // Input Names
            string[] asInputNames = new string[] {
                Data.InstrProperties.Symbol,
                Language.T("Direction"),
                Language.T("Number of lots"),
                Language.T("Entry price"),
                Language.T("Exit price"),
                Language.T("Days rollover"),
            };

            int number = 0;

            foreach (string name in asInputNames)
            {
                alblInputNames[number]           = new Label();
                alblInputNames[number].Parent    = pnlInput;
                alblInputNames[number].ForeColor = colorText;
                alblInputNames[number].BackColor = Color.Transparent;
                alblInputNames[number].AutoSize  = true;
                alblInputNames[number].Text      = name;
                number++;
            }

            // Label Lot size
            lblLotSize.Parent    = pnlInput;
            lblLotSize.ForeColor = colorText;
            lblLotSize.BackColor = Color.Transparent;

            // ComboBox SameDirAction
            cbxDirection.Parent        = pnlInput;
            cbxDirection.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxDirection.Items.AddRange(new string[] { Language.T("Long"), Language.T("Short") });
            cbxDirection.SelectedIndex = 0;

            // Lots
            nudLots.Parent = pnlInput;
            nudLots.BeginInit();
            nudLots.Minimum       = 0.01M;
            nudLots.Maximum       = 100;
            nudLots.Increment     = 0.01M;
            nudLots.DecimalPlaces = 2;
            nudLots.Value         = (decimal)Data.Strategy.EntryLots;
            nudLots.EndInit();

            // NumericUpDown Entry Price
            nudEntryPrice.Parent = pnlInput;

            // NumericUpDown Exit Price
            nudExitPrice.Parent = pnlInput;

            // NumericUpDown Reducing Lots
            nudDays.Parent = pnlInput;
            nudDays.BeginInit();
            nudDays.Minimum   = 0;
            nudDays.Maximum   = 1000;
            nudDays.Increment = 1;
            nudDays.Value     = 1;
            nudDays.EndInit();

            // Output Names
            string[] asOutputNames = new string[] {
                Language.T("Required margin"),
                Language.T("Gross profit"),
                Language.T("Spread"),
                Language.T("Entry commission"),
                Language.T("Exit commission"),
                Language.T("Rollover"),
                Language.T("Slippage"),
                Language.T("Net profit"),
            };

            number = 0;
            foreach (string name in asOutputNames)
            {
                alblOutputNames[number]           = new Label();
                alblOutputNames[number].Parent    = pnlOutput;
                alblOutputNames[number].ForeColor = colorText;
                alblOutputNames[number].BackColor = Color.Transparent;
                alblOutputNames[number].AutoSize  = true;
                alblOutputNames[number].Text      = name;

                alblOutputValues[number]           = new Label();
                alblOutputValues[number].Parent    = pnlOutput;
                alblOutputValues[number].ForeColor = colorText;
                alblOutputValues[number].BackColor = Color.Transparent;
                alblOutputValues[number].AutoSize  = true;

                number++;
            }

            alblOutputNames[number - 1].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[number - 1].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);

            timer          = new Timer();
            timer.Interval = 2000;
            timer.Tick    += new EventHandler(Timer_Tick);
            timer.Start();
        }
Exemplo n.º 26
0
        /// <summary>
        /// Initialize the form and controls
        /// </summary>
        public BarExplorer(int barNumber)
        {
            _pnlChart = new Panel();
            _pnlInfo  = new Panel();
            _toolTip  = new ToolTip();

            _barCurrent = barNumber < Data.FirstBar ? Data.FirstBar : barNumber;

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

            _fontInfo      = new Font(Font.FontFamily, 9);
            _infoRowHeight = Math.Max(_fontInfo.Height, 18);

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

            _pnlChart.Parent = this;
            _pnlChart.Paint += PnlChartPaint;

            _pnlInfo.Parent = this;
            _pnlInfo.Paint += PnlInfoPaint;

            BtnsNavigate = new Button[6];
            var btnNavigateText = new[] { "< !", "<<", "<", ">", ">>", "! >" };
            var btnNavigateTips = new[]
            {
                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++)
            {
                BtnsNavigate[i] = new Button {
                    Parent = this, Text = btnNavigateText[i], Name = btnNavigateText[i]
                };
                BtnsNavigate[i].Click      += BtnNavigateClick;
                BtnsNavigate[i].MouseWheel += BarExplorerMouseWheel;
                BtnsNavigate[i].KeyUp      += BtnNavigateKeyUp;
                BtnsNavigate[i].UseVisualStyleBackColor = true;
                _toolTip.SetToolTip(BtnsNavigate[i], btnNavigateTips[i]);
            }

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

            NUDGo = new NumericUpDown {
                Parent = this, TextAlign = HorizontalAlignment.Center
            };
            NUDGo.BeginInit();
            NUDGo.Minimum   = Data.FirstBar + 1;
            NUDGo.Maximum   = Data.Bars;
            NUDGo.Increment = 1;
            NUDGo.Value     = _barCurrent + 1;
            NUDGo.KeyUp    += BtnNavigateKeyUp;
            NUDGo.EndInit();

            BtnGo = new Button {
                Parent = this, Name = "Go", Text = Language.T("Go"), UseVisualStyleBackColor = true
            };
            BtnGo.Click      += BtnNavigateClick;
            BtnGo.MouseWheel += BarExplorerMouseWheel;
            BtnGo.KeyUp      += BtnNavigateKeyUp;
            _toolTip.SetToolTip(BtnGo, Language.T("Go to the chosen bar."));

            //Button Close
            BtnClose = new Button
            {
                Parent                  = this,
                Text                    = Language.T("Close"),
                DialogResult            = DialogResult.Cancel,
                UseVisualStyleBackColor = true
            };

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

            _brushCaptionText = new SolidBrush(LayoutColors.ColorCaptionText);
            _brushEvenRow     = new SolidBrush(LayoutColors.ColorEvenRowBack);
            _brushGridText    = new SolidBrush(LayoutColors.ColorChartFore);

            _penGrid = new Pen(LayoutColors.ColorChartGrid)
            {
                DashStyle = DashStyle.Dash, DashPattern = new float[] { 4, 2 }
            };
            _penAxes      = new Pen(LayoutColors.ColorChartFore);
            _penCross     = new Pen(LayoutColors.ColorChartCross);
            _penBarBorder = new Pen(LayoutColors.ColorBarBorder);

            _colorBarWight1 = Data.GetGradientColor(LayoutColors.ColorBarWhite, 30);
            _colorBarWight2 = Data.GetGradientColor(LayoutColors.ColorBarWhite, -30);
            _colorBarBlack1 = Data.GetGradientColor(LayoutColors.ColorBarBlack, 30);
            _colorBarBlack2 = Data.GetGradientColor(LayoutColors.ColorBarBlack, -30);

            _colorLongTrade1   = Data.GetGradientColor(LayoutColors.ColorTradeLong, 30);
            _colorLongTrade2   = Data.GetGradientColor(LayoutColors.ColorTradeLong, -30);
            _colorShortTrade1  = Data.GetGradientColor(LayoutColors.ColorTradeShort, 30);
            _colorShortTrade2  = Data.GetGradientColor(LayoutColors.ColorTradeShort, -30);
            _colorClosedTrade1 = Data.GetGradientColor(LayoutColors.ColorTradeClose, 30);
            _colorClosedTrade2 = Data.GetGradientColor(LayoutColors.ColorTradeClose, -30);

            SetJournalPoints();
        }
Exemplo n.º 27
0
 private void InitializeComponent()
 {
     components         = (IContainer) new Container();
     label1             = new Label();
     nudMinutes         = new NumericUpDown();
     nudTenth           = new NumericUpDown();
     nudSeconds         = new NumericUpDown();
     nudPlayerNo        = new NumericUpDown();
     lblPlayerNo        = new Label();
     contextMenuStrip1  = new ContextMenuStrip(components);
     aToolStripMenuItem = new ToolStripMenuItem();
     bToolStripMenuItem = new ToolStripMenuItem();
     cToolStripMenuItem = new ToolStripMenuItem();
     dToolStripMenuItem = new ToolStripMenuItem();
     mToolStripMenuItem = new ToolStripMenuItem();
     nudMinutes.BeginInit();
     nudTenth.BeginInit();
     nudSeconds.BeginInit();
     nudPlayerNo.BeginInit();
     contextMenuStrip1.SuspendLayout();
     SuspendLayout();
     label1.AutoSize     = true;
     label1.ImeMode      = ImeMode.NoControl;
     label1.Location     = new Point(31, 8);
     label1.Name         = "label1";
     label1.Size         = new Size(267, 13);
     label1.TabIndex     = 3;
     label1.Text         = "Nr.                    Min.                   Sek.                 Zehntel";
     nudMinutes.Location = new Point(90, 24);
     nudMinutes.Maximum  = new Decimal(new int[4]
     {
         120,
         0,
         0,
         0
     });
     nudMinutes.Name      = "nudMinutes";
     nudMinutes.Size      = new Size(72, 20);
     nudMinutes.TabIndex  = 0;
     nudMinutes.TextAlign = HorizontalAlignment.Center;
     nudTenth.Location    = new Point(246, 24);
     nudTenth.Maximum     = new Decimal(new int[4]
     {
         9,
         0,
         0,
         0
     });
     nudTenth.Name       = "nudTenth";
     nudTenth.Size       = new Size(72, 20);
     nudTenth.TabIndex   = 2;
     nudTenth.TextAlign  = HorizontalAlignment.Center;
     nudSeconds.Location = new Point(168, 24);
     nudSeconds.Maximum  = new Decimal(new int[4]
     {
         59,
         0,
         0,
         0
     });
     nudSeconds.Name              = "nudSeconds";
     nudSeconds.Size              = new Size(72, 20);
     nudSeconds.TabIndex          = 1;
     nudSeconds.TextAlign         = HorizontalAlignment.Center;
     nudPlayerNo.ContextMenuStrip = contextMenuStrip1;
     nudPlayerNo.Location         = new Point(12, 24);
     nudPlayerNo.Maximum          = new Decimal(new int[4]
     {
         99,
         0,
         0,
         0
     });
     nudPlayerNo.Name          = "nudPlayerNo";
     nudPlayerNo.Size          = new Size(72, 20);
     nudPlayerNo.TabIndex      = 6;
     nudPlayerNo.TextAlign     = HorizontalAlignment.Center;
     nudPlayerNo.ValueChanged += new EventHandler(nudPlayerNo_ValueChanged);
     lblPlayerNo.AutoSize      = true;
     lblPlayerNo.Font          = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, (byte)0);
     lblPlayerNo.Location      = new Point(34, 47);
     lblPlayerNo.Name          = "lblPlayerNo";
     lblPlayerNo.Size          = new Size(0, 13);
     lblPlayerNo.TabIndex      = 7;
     contextMenuStrip1.Items.AddRange(new ToolStripItem[5]
     {
         (ToolStripItem)aToolStripMenuItem,
         (ToolStripItem)bToolStripMenuItem,
         (ToolStripItem)cToolStripMenuItem,
         (ToolStripItem)dToolStripMenuItem,
         (ToolStripItem)mToolStripMenuItem
     });
     contextMenuStrip1.Name    = "contextMenuStrip1";
     contextMenuStrip1.Size    = new Size(94, 114);
     aToolStripMenuItem.Name   = "aToolStripMenuItem";
     aToolStripMenuItem.Size   = new Size(152, 22);
     aToolStripMenuItem.Text   = "A";
     aToolStripMenuItem.Click += new EventHandler(setPenaltyToOfficial_Click);
     bToolStripMenuItem.Name   = "bToolStripMenuItem";
     bToolStripMenuItem.Size   = new Size(152, 22);
     bToolStripMenuItem.Text   = "B";
     bToolStripMenuItem.Click += new EventHandler(setPenaltyToOfficial_Click);
     cToolStripMenuItem.Name   = "cToolStripMenuItem";
     cToolStripMenuItem.Size   = new Size(152, 22);
     cToolStripMenuItem.Text   = "C";
     cToolStripMenuItem.Click += new EventHandler(setPenaltyToOfficial_Click);
     dToolStripMenuItem.Name   = "dToolStripMenuItem";
     dToolStripMenuItem.Size   = new Size(152, 22);
     dToolStripMenuItem.Text   = "D";
     dToolStripMenuItem.Click += new EventHandler(setPenaltyToOfficial_Click);
     mToolStripMenuItem.Name   = "mToolStripMenuItem";
     mToolStripMenuItem.Size   = new Size(152, 22);
     mToolStripMenuItem.Text   = "M";
     mToolStripMenuItem.Click += new EventHandler(setPenaltyToOfficial_Click);
     AutoScaleDimensions       = new SizeF(6f, 13f);
     AutoScaleMode             = AutoScaleMode.Font;
     ClientSize = new Size(341, 65);
     Controls.Add((Control)lblPlayerNo);
     Controls.Add((Control)label1);
     Controls.Add((Control)nudPlayerNo);
     Controls.Add((Control)nudMinutes);
     Controls.Add((Control)nudTenth);
     Controls.Add((Control)nudSeconds);
     FormBorderStyle = FormBorderStyle.FixedSingle;
     KeyPreview      = true;
     MaximizeBox     = false;
     MinimizeBox     = false;
     Name            = nameof(EditPenalty);
     StartPosition   = FormStartPosition.CenterParent;
     Text            = "Strafzeit editieren";
     FormClosing    += new FormClosingEventHandler(EditPenalty_FormClosing);
     KeyDown        += new KeyEventHandler(EditPenalty_KeyDown);
     nudMinutes.EndInit();
     nudTenth.EndInit();
     nudSeconds.EndInit();
     nudPlayerNo.EndInit();
     contextMenuStrip1.ResumeLayout(false);
     ResumeLayout(false);
     PerformLayout();
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        public OandaTickDataImport()
        {
            LblIntro      = new Label();
            TxbFileName   = new TextBox();
            BtnBrowse     = new Button();
            LblSymbol     = new Label();
            TxbSymbol     = new TextBox();
            LblMinBars    = new Label();
            NudMinBars    = new NumericUpDown();
            PnlSettings   = new FancyPanel();
            PnlImportInfo = new FancyPanel(Language.T("Imported Data"));
            TbxInfo       = new TextBox();
            LblDestFolder = new Label();
            TxbDestFolder = new TextBox();
            BtnDestFolder = new Button();
            BtnHelp       = new Button();
            BtnClose      = new Button();
            BtnImport     = new Button();
            ProgressBar   = new ProgressBar();

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

            // Label Intro
            LblIntro.Parent    = PnlSettings;
            LblIntro.ForeColor = LayoutColors.ColorControlText;
            LblIntro.BackColor = Color.Transparent;
            LblIntro.AutoSize  = true;
            LblIntro.Text      = Language.T("Select an Oanda file for import") + ":";

            // File Name
            TxbFileName.Parent    = PnlSettings;
            TxbFileName.BackColor = LayoutColors.ColorControlBack;
            TxbFileName.ForeColor = LayoutColors.ColorControlText;
            TxbFileName.Text      = string.Empty;

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

            // Label Symbol
            LblSymbol.Parent    = PnlSettings;
            LblSymbol.ForeColor = LayoutColors.ColorControlText;
            LblSymbol.BackColor = Color.Transparent;
            LblSymbol.AutoSize  = true;
            LblSymbol.Text      = Language.T("Enter Symbol") + ":";

            // Symbol
            TxbSymbol.Parent    = PnlSettings;
            TxbSymbol.BackColor = LayoutColors.ColorControlBack;
            TxbSymbol.ForeColor = LayoutColors.ColorControlText;
            TxbSymbol.Text      = string.Empty;

            // Label Symbol
            LblMinBars.Parent    = PnlSettings;
            LblMinBars.ForeColor = LayoutColors.ColorControlText;
            LblMinBars.BackColor = Color.Transparent;
            LblMinBars.AutoSize  = true;
            LblMinBars.Text      = Language.T("Minimum bars in bar files") + ":";

            // Minimum Bars
            NudMinBars.Parent = PnlSettings;
            NudMinBars.BeginInit();
            NudMinBars.Minimum = 0;
            NudMinBars.Maximum = int.MaxValue;
            NudMinBars.Value   = Configs.MinBarsInBarFile;
            NudMinBars.EndInit();

            // LblDestFolder
            LblDestFolder.Parent    = PnlSettings;
            LblDestFolder.ForeColor = LayoutColors.ColorControlText;
            LblDestFolder.BackColor = Color.Transparent;
            LblDestFolder.AutoSize  = true;
            LblDestFolder.Text      = Language.T("Select a destination folder") + ":";

            // TxbDestFolder
            TxbDestFolder.Parent    = PnlSettings;
            TxbDestFolder.BackColor = LayoutColors.ColorControlBack;
            TxbDestFolder.ForeColor = LayoutColors.ColorControlText;
            TxbDestFolder.Text      = String.IsNullOrEmpty(Configs.OandaImportDestFolder) ? Data.OfflineDataDir : Configs.OandaImportDestFolder;

            // BtnDestFolder
            BtnDestFolder.Parent = PnlSettings;
            BtnDestFolder.Name   = "BtnDestFolder";
            BtnDestFolder.Text   = Language.T("Browse");
            BtnDestFolder.Click += BtnDestFolderClick;
            BtnDestFolder.UseVisualStyleBackColor = true;

            // PnlSettings
            PnlSettings.Parent = this;

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

            // TbxInfo
            TbxInfo.Parent        = PnlImportInfo;
            TbxInfo.BorderStyle   = BorderStyle.None;
            TbxInfo.Dock          = DockStyle.Fill;
            TbxInfo.BackColor     = LayoutColors.ColorControlBack;
            TbxInfo.ForeColor     = LayoutColors.ColorControlText;
            TbxInfo.Multiline     = true;
            TbxInfo.AcceptsReturn = true;
            TbxInfo.AcceptsTab    = true;
            TbxInfo.ScrollBars    = ScrollBars.Vertical;

            // ProgressBar
            ProgressBar.Parent = this;

            // Button Help
            BtnHelp.Parent = this;
            BtnHelp.Name   = "Help";
            BtnHelp.Text   = Language.T("Help");
            BtnHelp.Click += BtnHelpClick;
            BtnHelp.UseVisualStyleBackColor = true;

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

            // Button Import
            BtnImport.Parent = this;
            BtnImport.Name   = "Import";
            BtnImport.Text   = Language.T("Import");
            BtnImport.Click += BtnImportClick;
            BtnImport.UseVisualStyleBackColor = true;

            // BackGroundWorker
            _bgWorker = new BackgroundWorker {
                WorkerReportsProgress = true, WorkerSupportsCancellation = true
            };
            _bgWorker.DoWork             += BgWorkerDoWork;
            _bgWorker.RunWorkerCompleted += BgWorkerRunWorkerCompleted;
        }
Exemplo n.º 29
0
        private void InitializeComponent()
        {
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(TeamEditor));

            txtTeamName            = new TextBox();
            label1                 = new Label();
            lbAvailablePlayers     = new ListBox();
            label2                 = new Label();
            pbTeamLogo             = new PictureBox();
            txtPlayerName          = new TextBox();
            nudPlayerNumber        = new NumericUpDown();
            label3                 = new Label();
            label4                 = new Label();
            label5                 = new Label();
            btnDeletePlayer        = new Button();
            btnNewPlayer           = new Button();
            openFileDialogTeamLogo = new OpenFileDialog();
            btnSavePlayer          = new Button();
            btnImportPlayerList    = new Button();
            openFileDialog1        = new OpenFileDialog();
            pbPlayerImage          = new PictureBox();
            openFileDialog2        = new OpenFileDialog();
            label6                 = new Label();
            rbIsPlayer             = new RadioButton();
            rbIsCoach              = new RadioButton();
            rbIsCoTrainer          = new RadioButton();
            cbNameToUpper          = new CheckBox();
            cbIsGoalkeeper         = new CheckBox();
            ((ISupportInitialize)pbTeamLogo).BeginInit();
            nudPlayerNumber.BeginInit();
            ((ISupportInitialize)pbPlayerImage).BeginInit();
            SuspendLayout();
            txtTeamName.AccessibleDescription = (string)null;
            txtTeamName.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)txtTeamName, "txtTeamName");
            txtTeamName.BackgroundImage  = (Image)null;
            txtTeamName.Font             = (Font)null;
            txtTeamName.Name             = "txtTeamName";
            txtTeamName.TextChanged     += new EventHandler(txtTeamName_TextChanged);
            txtTeamName.Leave           += new EventHandler(txtTeamName_Leave);
            label1.AccessibleDescription = (string)null;
            label1.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)label1, "label1");
            label1.Font = (Font)null;
            label1.Name = "label1";
            lbAvailablePlayers.AccessibleDescription = (string)null;
            lbAvailablePlayers.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)lbAvailablePlayers, "lbAvailablePlayers");
            lbAvailablePlayers.BackgroundImage   = (Image)null;
            lbAvailablePlayers.FormattingEnabled = true;
            lbAvailablePlayers.Name    = "lbAvailablePlayers";
            lbAvailablePlayers.TabStop = false;
            lbAvailablePlayers.SelectedIndexChanged += new EventHandler(lbAvailablePlayers_SelectedIndexChanged);
            label2.AccessibleDescription             = (string)null;
            label2.AccessibleName = (string)null;
            componentResourceManager.ApplyResources((object)label2, "label2");
            label2.Font = (Font)null;
            label2.Name = "label2";
            pbTeamLogo.AccessibleDescription = (string)null;
            pbTeamLogo.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)pbTeamLogo, "pbTeamLogo");
            pbTeamLogo.BackgroundImage          = (Image)null;
            pbTeamLogo.BorderStyle              = BorderStyle.FixedSingle;
            pbTeamLogo.Font                     = (Font)null;
            pbTeamLogo.ImageLocation            = (string)null;
            pbTeamLogo.Name                     = "pbTeamLogo";
            pbTeamLogo.TabStop                  = false;
            pbTeamLogo.Click                   += new EventHandler(pbTeamLogo_Click);
            txtPlayerName.AccessibleDescription = (string)null;
            txtPlayerName.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)txtPlayerName, "txtPlayerName");
            txtPlayerName.BackgroundImage         = (Image)null;
            txtPlayerName.Font                    = (Font)null;
            txtPlayerName.Name                    = "txtPlayerName";
            txtPlayerName.TextChanged            += new EventHandler(txtPlayerName_TextChanged);
            nudPlayerNumber.AccessibleDescription = (string)null;
            nudPlayerNumber.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)nudPlayerNumber, "nudPlayerNumber");
            nudPlayerNumber.Font    = (Font)null;
            nudPlayerNumber.Minimum = new Decimal(new int[4]
            {
                2,
                0,
                0,
                int.MinValue
            });
            nudPlayerNumber.Name          = "nudPlayerNumber";
            nudPlayerNumber.ValueChanged += new EventHandler(nudPlayerNumber_ValueChanged);
            label3.AccessibleDescription  = (string)null;
            label3.AccessibleName         = (string)null;
            componentResourceManager.ApplyResources((object)label3, "label3");
            label3.Font = (Font)null;
            label3.Name = "label3";
            label4.AccessibleDescription = (string)null;
            label4.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)label4, "label4");
            label4.Font = (Font)null;
            label4.Name = "label4";
            label5.AccessibleDescription = (string)null;
            label5.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)label5, "label5");
            label5.Font = (Font)null;
            label5.Name = "label5";
            btnDeletePlayer.AccessibleDescription = (string)null;
            btnDeletePlayer.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)btnDeletePlayer, "btnDeletePlayer");
            btnDeletePlayer.BackgroundImage         = (Image)null;
            btnDeletePlayer.Font                    = (Font)null;
            btnDeletePlayer.Name                    = "btnDeletePlayer";
            btnDeletePlayer.TabStop                 = false;
            btnDeletePlayer.UseVisualStyleBackColor = true;
            btnDeletePlayer.Click                  += new EventHandler(btnDeletePlayer_Click);
            btnNewPlayer.AccessibleDescription      = (string)null;
            btnNewPlayer.AccessibleName             = (string)null;
            componentResourceManager.ApplyResources((object)btnNewPlayer, "btnNewPlayer");
            btnNewPlayer.BackgroundImage            = (Image)null;
            btnNewPlayer.Font                       = (Font)null;
            btnNewPlayer.Name                       = "btnNewPlayer";
            btnNewPlayer.TabStop                    = false;
            btnNewPlayer.UseVisualStyleBackColor    = true;
            btnNewPlayer.Click                     += new EventHandler(btnNewPlayer_Click);
            openFileDialogTeamLogo.DereferenceLinks = false;
            componentResourceManager.ApplyResources((object)openFileDialogTeamLogo, "openFileDialogTeamLogo");
            openFileDialogTeamLogo.InitialDirectory = "c:\\";
            openFileDialogTeamLogo.FileOk          += new CancelEventHandler(openFileDialogTeamLogo_FileOk);
            btnSavePlayer.AccessibleDescription     = (string)null;
            btnSavePlayer.AccessibleName            = (string)null;
            componentResourceManager.ApplyResources((object)btnSavePlayer, "btnSavePlayer");
            btnSavePlayer.BackgroundImage             = (Image)null;
            btnSavePlayer.Font                        = (Font)null;
            btnSavePlayer.Name                        = "btnSavePlayer";
            btnSavePlayer.TabStop                     = false;
            btnSavePlayer.UseVisualStyleBackColor     = true;
            btnSavePlayer.Click                      += new EventHandler(btnSavePlayer_Click);
            btnImportPlayerList.AccessibleDescription = (string)null;
            btnImportPlayerList.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)btnImportPlayerList, "btnImportPlayerList");
            btnImportPlayerList.BackgroundImage         = (Image)null;
            btnImportPlayerList.Font                    = (Font)null;
            btnImportPlayerList.Name                    = "btnImportPlayerList";
            btnImportPlayerList.UseVisualStyleBackColor = true;
            btnImportPlayerList.Click                  += new EventHandler(btnImportPlayerList_Click);
            componentResourceManager.ApplyResources((object)openFileDialog1, "openFileDialog1");
            openFileDialog1.InitialDirectory    = "c:\\";
            openFileDialog1.FileOk             += new CancelEventHandler(openFileDialog1_FileOk);
            pbPlayerImage.AccessibleDescription = (string)null;
            pbPlayerImage.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)pbPlayerImage, "pbPlayerImage");
            pbPlayerImage.BackgroundImage    = (Image)null;
            pbPlayerImage.BorderStyle        = BorderStyle.FixedSingle;
            pbPlayerImage.Font               = (Font)null;
            pbPlayerImage.ImageLocation      = (string)null;
            pbPlayerImage.Name               = "pbPlayerImage";
            pbPlayerImage.TabStop            = false;
            pbPlayerImage.Click             += new EventHandler(pbPlayerImage_Click);
            openFileDialog2.DereferenceLinks = false;
            componentResourceManager.ApplyResources((object)openFileDialog2, "openFileDialog2");
            openFileDialog2.InitialDirectory = "c:\\";
            openFileDialog2.FileOk          += new CancelEventHandler(openFileDialog2_FileOk);
            label6.AccessibleDescription     = (string)null;
            label6.AccessibleName            = (string)null;
            componentResourceManager.ApplyResources((object)label6, "label6");
            label6.Font = (Font)null;
            label6.Name = "label6";
            rbIsPlayer.AccessibleDescription = (string)null;
            rbIsPlayer.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)rbIsPlayer, "rbIsPlayer");
            rbIsPlayer.BackgroundImage         = (Image)null;
            rbIsPlayer.Checked                 = true;
            rbIsPlayer.Font                    = (Font)null;
            rbIsPlayer.Name                    = "rbIsPlayer";
            rbIsPlayer.TabStop                 = true;
            rbIsPlayer.UseVisualStyleBackColor = true;
            rbIsPlayer.Click                  += new EventHandler(rbIsPlayer_Click);
            rbIsCoach.AccessibleDescription    = (string)null;
            rbIsCoach.AccessibleName           = (string)null;
            componentResourceManager.ApplyResources((object)rbIsCoach, "rbIsCoach");
            rbIsCoach.BackgroundImage           = (Image)null;
            rbIsCoach.Font                      = (Font)null;
            rbIsCoach.Name                      = "rbIsCoach";
            rbIsCoach.UseVisualStyleBackColor   = true;
            rbIsCoach.Click                    += new EventHandler(rbIsCoach_Click);
            rbIsCoTrainer.AccessibleDescription = (string)null;
            rbIsCoTrainer.AccessibleName        = (string)null;
            componentResourceManager.ApplyResources((object)rbIsCoTrainer, "rbIsCoTrainer");
            rbIsCoTrainer.BackgroundImage         = (Image)null;
            rbIsCoTrainer.Font                    = (Font)null;
            rbIsCoTrainer.Name                    = "rbIsCoTrainer";
            rbIsCoTrainer.UseVisualStyleBackColor = true;
            rbIsCoTrainer.Click                  += new EventHandler(rbIsCoTrainer_Click);
            cbNameToUpper.AccessibleDescription   = (string)null;
            cbNameToUpper.AccessibleName          = (string)null;
            componentResourceManager.ApplyResources((object)cbNameToUpper, "cbNameToUpper");
            cbNameToUpper.BackgroundImage         = (Image)null;
            cbNameToUpper.Font                    = (Font)null;
            cbNameToUpper.Name                    = "cbNameToUpper";
            cbNameToUpper.UseVisualStyleBackColor = true;
            cbNameToUpper.CheckedChanged         += new EventHandler(cbNameToUpper_CheckedChanged);
            cbIsGoalkeeper.AccessibleDescription  = (string)null;
            cbIsGoalkeeper.AccessibleName         = (string)null;
            componentResourceManager.ApplyResources((object)cbIsGoalkeeper, "cbIsGoalkeeper");
            cbIsGoalkeeper.BackgroundImage         = (Image)null;
            cbIsGoalkeeper.Font                    = (Font)null;
            cbIsGoalkeeper.Name                    = "cbIsGoalkeeper";
            cbIsGoalkeeper.UseVisualStyleBackColor = true;
            AccessibleDescription                  = (string)null;
            AccessibleName = (string)null;
            componentResourceManager.ApplyResources((object)this, "$this");
            AutoScaleMode   = AutoScaleMode.Font;
            BackgroundImage = (Image)null;
            Controls.Add((Control)cbIsGoalkeeper);
            Controls.Add((Control)cbNameToUpper);
            Controls.Add((Control)rbIsCoTrainer);
            Controls.Add((Control)rbIsCoach);
            Controls.Add((Control)rbIsPlayer);
            Controls.Add((Control)pbPlayerImage);
            Controls.Add((Control)btnImportPlayerList);
            Controls.Add((Control)btnSavePlayer);
            Controls.Add((Control)btnDeletePlayer);
            Controls.Add((Control)btnNewPlayer);
            Controls.Add((Control)label5);
            Controls.Add((Control)label4);
            Controls.Add((Control)label3);
            Controls.Add((Control)nudPlayerNumber);
            Controls.Add((Control)txtPlayerName);
            Controls.Add((Control)pbTeamLogo);
            Controls.Add((Control)label2);
            Controls.Add((Control)lbAvailablePlayers);
            Controls.Add((Control)label1);
            Controls.Add((Control)txtTeamName);
            Controls.Add((Control)label6);
            Font            = (Font)null;
            FormBorderStyle = FormBorderStyle.FixedSingle;
            Icon            = (Icon)null;
            KeyPreview      = true;
            MaximizeBox     = false;
            MinimizeBox     = false;
            Name            = nameof(TeamEditor);
            FormClosing    += new FormClosingEventHandler(TeamEditor_FormClosing);
            KeyDown        += new KeyEventHandler(TeamEditor_KeyDown);
            ((ISupportInitialize)pbTeamLogo).EndInit();
            nudPlayerNumber.EndInit();
            ((ISupportInitialize)pbPlayerImage).EndInit();
            ResumeLayout(false);
            PerformLayout();
        }
Exemplo n.º 30
0
        /// <summary>
        /// Constructor
        /// </summary>
        public JForex_Import()
        {
            lblIntro         = new Label();
            txbDataDirectory = new TextBox();
            btnBrowse        = new Button();
            pnlSettings      = new Fancy_Panel();
            pnlInfoBase      = new Fancy_Panel(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();

            font      = this.Font;
            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 += new EventHandler(BtnBrowse_Click);
            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;
            tbxInfo.AcceptsReturn = true;
            tbxInfo.AcceptsTab    = true;
            tbxInfo.ScrollBars    = ScrollBars.Vertical;

            // ProgressBar
            progressBar.Parent = this;

            // Button Help
            btnHelp.Parent = this;
            btnHelp.Name   = "Help";
            btnHelp.Text   = Language.T("Help");
            btnHelp.Click += new EventHandler(BtnHelp_Click);
            btnHelp.UseVisualStyleBackColor = true;

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

            // Button Import
            btnImport.Parent = this;
            btnImport.Name   = "Import";
            btnImport.Text   = Language.T("Import");
            btnImport.Click += new EventHandler(BtnImport_Click);
            btnImport.UseVisualStyleBackColor = true;

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