public StrategyProperties()
        {
            PnlAveraging  = new FancyPanel(Language.T("Handling of Additional Entry Signals"), LayoutColors.ColorSlotCaptionBackAveraging);
            PnlAmounts    = new FancyPanel(Language.T("Trading Size"), LayoutColors.ColorSlotCaptionBackAveraging);
            PnlProtection = new FancyPanel(Language.T("Permanent Protection"), LayoutColors.ColorSlotCaptionBackAveraging);
            BalanceChart  = new SmallBalanceChart();

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

            LblSameDirAction = new Label();
            LblOppDirAction  = new Label();

            CbxSameDirAction        = new ComboBox();
            CbxOppDirAction         = new ComboBox();
            NUDMaxOpenLots          = new NUD();
            RbConstantUnits         = new RadioButton();
            RbVariableUnits         = new RadioButton();
            NUDEntryLots            = new NUD();
            NUDAddingLots           = new NUD();
            NUDReducingLots         = new NUD();
            LblMaxOpenLots          = new Label();
            LblEntryLots            = new Label();
            LblAddingLots           = new Label();
            LblReducingLots         = new Label();
            CbxUseMartingale        = new CheckBox();
            NUDMartingaleMultiplier = new NUD();

            ChbPermaSL     = new CheckBox();
            CbxPermaSLType = new ComboBox();
            NUDPermaSL     = new NUD();
            ChbPermaTP     = new CheckBox();
            CbxPermaTPType = new ComboBox();
            NUDPermaTP     = new NUD();
            ChbBreakEven   = new CheckBox();
            NUDBreakEven   = new NUD();

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

            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.Parent  = this;
            PnlAmounts.Parent    = this;
            PnlProtection.Parent = this;
            BalanceChart.Parent  = this;
            BalanceChart.SetChartData();

            var toolTip = new ToolTip();

            // Label Same dir action
            LblSameDirAction.Parent    = PnlAveraging;
            LblSameDirAction.ForeColor = ColorText;
            LblSameDirAction.BackColor = Color.Transparent;
            LblSameDirAction.AutoSize  = true;
            LblSameDirAction.Text      = Language.T("Next same direction signal behavior");

            // Label Opposite dir action
            LblOppDirAction.Parent    = PnlAveraging;
            LblOppDirAction.ForeColor = ColorText;
            LblOppDirAction.BackColor = Color.Transparent;
            LblOppDirAction.AutoSize  = true;
            LblOppDirAction.Text      = Language.T("Next opposite direction signal behavior");

            // ComboBox SameDirAction
            CbxSameDirAction.Parent        = PnlAveraging;
            CbxSameDirAction.Name          = "cbxSameDirAction";
            CbxSameDirAction.DropDownStyle = ComboBoxStyle.DropDownList;
            var sameItems = new[] { Language.T("Nothing"), Language.T("Winner"), Language.T("Add") };

            foreach (var item in sameItems)
            {
                CbxSameDirAction.Items.Add(item);
            }
            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;
            var oppItems = new[] { Language.T("Nothing"), Language.T("Reduce"), Language.T("Close"), Language.T("Reverse") };

            foreach (var item in oppItems)
            {
                CbxOppDirAction.Items.Add(item);
            }
            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         = 20;
            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   = true;
            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   = false;
            RbVariableUnits.AutoSize  = false;
            RbVariableUnits.Name      = "rbVariableUnits";
            RbVariableUnits.Text      = Language.T("Trade percent of your account. 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         = 1;
            NUDEntryLots.DecimalPlaces = 2;
            NUDEntryLots.TextAlign     = HorizontalAlignment.Center;
            NUDEntryLots.EndInit();

            // Label Entry Lots %
            LblPercent1.Parent    = PnlAmounts;
            LblPercent1.ForeColor = ColorText;
            LblPercent1.BackColor = Color.Transparent;

            // 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         = 1;
            NUDAddingLots.DecimalPlaces = 2;
            NUDAddingLots.TextAlign     = HorizontalAlignment.Center;
            NUDAddingLots.EndInit();

            // Label Adding Lots %
            LblPercent2.Parent    = PnlAmounts;
            LblPercent2.ForeColor = ColorText;
            LblPercent2.BackColor = Color.Transparent;

            // 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.DecimalPlaces = 2;
            NUDReducingLots.Value         = 1;
            NUDReducingLots.TextAlign     = HorizontalAlignment.Center;
            NUDReducingLots.EndInit();

            // CheckBox Use Martingale
            CbxUseMartingale.Name      = "cbxUseMartingale";
            CbxUseMartingale.Parent    = PnlAmounts;
            CbxUseMartingale.ForeColor = ColorText;
            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();


            // Label Reducing Lots %
            LblPercent3.Parent    = PnlAmounts;
            LblPercent3.ForeColor = ColorText;
            LblPercent3.BackColor = Color.Transparent;

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

            // ComboBox cbxPermaSLType
            CbxPermaSLType.Parent        = PnlProtection;
            CbxPermaSLType.Name          = "cbxPermaSLType";
            CbxPermaSLType.Visible       = false;
            CbxPermaSLType.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPermaSLType.Items.Add(Language.T("Relative"));
            CbxPermaSLType.Items.Add(Language.T("Absolute"));
            CbxPermaSLType.SelectedIndex = 0;

            // NumericUpDown Permanent S/L
            NUDPermaSL.Name   = "nudPermaSL";
            NUDPermaSL.Parent = PnlProtection;
            NUDPermaSL.BeginInit();
            NUDPermaSL.Minimum   = 5;
            NUDPermaSL.Maximum   = 5000;
            NUDPermaSL.Increment = 1;
            NUDPermaSL.Value     = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            NUDPermaSL.TextAlign = HorizontalAlignment.Center;
            NUDPermaSL.EndInit();

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

            // ComboBox cbxPermaTPType
            CbxPermaTPType.Parent        = PnlProtection;
            CbxPermaTPType.Name          = "cbxPermaTPType";
            CbxPermaTPType.Visible       = false;
            CbxPermaTPType.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPermaTPType.Items.Add(Language.T("Relative"));
            CbxPermaTPType.Items.Add(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     = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            NUDPermaTP.TextAlign = HorizontalAlignment.Center;
            NUDPermaTP.EndInit();

            // CheckBox Break Even
            ChbBreakEven.Name      = "chbBreakEven";
            ChbBreakEven.Parent    = PnlProtection;
            ChbBreakEven.ForeColor = ColorText;
            ChbBreakEven.BackColor = Color.Transparent;
            ChbBreakEven.AutoCheck = true;
            ChbBreakEven.AutoSize  = true;
            ChbBreakEven.Checked   = false;
            ChbBreakEven.Text      = Language.T("Break Even");

            // NumericUpDown Break Even
            NUDBreakEven.Parent = PnlProtection;
            NUDBreakEven.Name   = "nudBreakEven";
            NUDBreakEven.BeginInit();
            NUDBreakEven.Minimum   = 5;
            NUDBreakEven.Maximum   = 5000;
            NUDBreakEven.Increment = 1;
            NUDBreakEven.Value     = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            NUDBreakEven.TextAlign = HorizontalAlignment.Center;
            NUDBreakEven.EndInit();

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

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

            //Button Accept
            BtnAccept.Parent                  = this;
            BtnAccept.Name                    = "btnAccept";
            BtnAccept.Text                    = Language.T("Accept");
            BtnAccept.DialogResult            = DialogResult.OK;
            BtnAccept.UseVisualStyleBackColor = true;
        }
        public StrategyProperties()
        {
            PnlAveraging = new FancyPanel(Language.T("Handling of Additional Entry Signals"), LayoutColors.ColorSlotCaptionBackAveraging);
            PnlAmounts = new FancyPanel(Language.T("Trading Size"), LayoutColors.ColorSlotCaptionBackAveraging);
            PnlProtection = new FancyPanel(Language.T("Permanent Protection"), LayoutColors.ColorSlotCaptionBackAveraging);
            BalanceChart = new SmallBalanceChart();

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

            LblSameDirAction = new Label();
            LblOppDirAction = new Label();

            CbxSameDirAction = new ComboBox();
            CbxOppDirAction = new ComboBox();
            NUDMaxOpenLots = new NUD();
            RbConstantUnits = new RadioButton();
            RbVariableUnits = new RadioButton();
            NUDEntryLots = new NUD();
            NUDAddingLots = new NUD();
            NUDReducingLots = new NUD();
            LblMaxOpenLots = new Label();
            LblEntryLots = new Label();
            LblAddingLots = new Label();
            LblReducingLots = new Label();
            CbxUseMartingale = new CheckBox();
            NUDMartingaleMultiplier = new NUD();

            ChbPermaSL = new CheckBox();
            CbxPermaSLType = new ComboBox();
            NUDPermaSL = new NUD();
            ChbPermaTP = new CheckBox();
            CbxPermaTPType = new ComboBox();
            NUDPermaTP = new NUD();
            ChbBreakEven = new CheckBox();
            NUDBreakEven = new NUD();

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

            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.Parent = this;
            PnlAmounts.Parent = this;
            PnlProtection.Parent = this;
            BalanceChart.Parent = this;
            BalanceChart.SetChartData();

            var toolTip = new ToolTip();

            // Label Same dir action
            LblSameDirAction.Parent = PnlAveraging;
            LblSameDirAction.ForeColor = ColorText;
            LblSameDirAction.BackColor = Color.Transparent;
            LblSameDirAction.AutoSize = true;
            LblSameDirAction.Text = Language.T("Next same direction signal behavior");

            // Label Opposite dir action
            LblOppDirAction.Parent = PnlAveraging;
            LblOppDirAction.ForeColor = ColorText;
            LblOppDirAction.BackColor = Color.Transparent;
            LblOppDirAction.AutoSize = true;
            LblOppDirAction.Text = Language.T("Next opposite direction signal behavior");

            // ComboBox SameDirAction
            CbxSameDirAction.Parent = PnlAveraging;
            CbxSameDirAction.Name = "cbxSameDirAction";
            CbxSameDirAction.DropDownStyle = ComboBoxStyle.DropDownList;
            var sameItems = new[] {Language.T("Nothing"), Language.T("Winner"), Language.T("Add")};
            foreach (var item in sameItems)
                CbxSameDirAction.Items.Add(item);
            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;
            var oppItems = new[] { Language.T("Nothing"), Language.T("Reduce"), Language.T("Close"), Language.T("Reverse") };
            foreach (var item in oppItems)
                CbxOppDirAction.Items.Add(item);
            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 = 20;
            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 = true;
            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 = false;
            RbVariableUnits.AutoSize = false;
            RbVariableUnits.Name = "rbVariableUnits";
            RbVariableUnits.Text = Language.T("Trade percent of your account. 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 = 1;
            NUDEntryLots.DecimalPlaces = 2;
            NUDEntryLots.TextAlign = HorizontalAlignment.Center;
            NUDEntryLots.EndInit();

            // Label Entry Lots %
            LblPercent1.Parent = PnlAmounts;
            LblPercent1.ForeColor = ColorText;
            LblPercent1.BackColor = Color.Transparent;

            // 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 = 1;
            NUDAddingLots.DecimalPlaces = 2;
            NUDAddingLots.TextAlign = HorizontalAlignment.Center;
            NUDAddingLots.EndInit();

            // Label Adding Lots %
            LblPercent2.Parent = PnlAmounts;
            LblPercent2.ForeColor = ColorText;
            LblPercent2.BackColor = Color.Transparent;

            // 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.DecimalPlaces = 2;
            NUDReducingLots.Value = 1;
            NUDReducingLots.TextAlign = HorizontalAlignment.Center;
            NUDReducingLots.EndInit();

            // CheckBox Use Martingale
            CbxUseMartingale.Name = "cbxUseMartingale";
            CbxUseMartingale.Parent = PnlAmounts;
            CbxUseMartingale.ForeColor = ColorText;
            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();

            // Label Reducing Lots %
            LblPercent3.Parent = PnlAmounts;
            LblPercent3.ForeColor = ColorText;
            LblPercent3.BackColor = Color.Transparent;

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

            // ComboBox cbxPermaSLType
            CbxPermaSLType.Parent = PnlProtection;
            CbxPermaSLType.Name = "cbxPermaSLType";
            CbxPermaSLType.Visible = false;
            CbxPermaSLType.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPermaSLType.Items.Add(Language.T("Relative"));
            CbxPermaSLType.Items.Add(Language.T("Absolute"));
            CbxPermaSLType.SelectedIndex = 0;

            // NumericUpDown Permanent S/L
            NUDPermaSL.Name = "nudPermaSL";
            NUDPermaSL.Parent = PnlProtection;
            NUDPermaSL.BeginInit();
            NUDPermaSL.Minimum = 5;
            NUDPermaSL.Maximum = 5000;
            NUDPermaSL.Increment = 1;
            NUDPermaSL.Value = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            NUDPermaSL.TextAlign = HorizontalAlignment.Center;
            NUDPermaSL.EndInit();

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

            // ComboBox cbxPermaTPType
            CbxPermaTPType.Parent = PnlProtection;
            CbxPermaTPType.Name = "cbxPermaTPType";
            CbxPermaTPType.Visible = false;
            CbxPermaTPType.DropDownStyle = ComboBoxStyle.DropDownList;
            CbxPermaTPType.Items.Add(Language.T("Relative"));
            CbxPermaTPType.Items.Add(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 = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            NUDPermaTP.TextAlign = HorizontalAlignment.Center;
            NUDPermaTP.EndInit();

            // CheckBox Break Even
            ChbBreakEven.Name = "chbBreakEven";
            ChbBreakEven.Parent = PnlProtection;
            ChbBreakEven.ForeColor = ColorText;
            ChbBreakEven.BackColor = Color.Transparent;
            ChbBreakEven.AutoCheck = true;
            ChbBreakEven.AutoSize = true;
            ChbBreakEven.Checked = false;
            ChbBreakEven.Text = Language.T("Break Even");

            // NumericUpDown Break Even
            NUDBreakEven.Parent = PnlProtection;
            NUDBreakEven.Name = "nudBreakEven";
            NUDBreakEven.BeginInit();
            NUDBreakEven.Minimum = 5;
            NUDBreakEven.Maximum = 5000;
            NUDBreakEven.Increment = 1;
            NUDBreakEven.Value = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            NUDBreakEven.TextAlign = HorizontalAlignment.Center;
            NUDBreakEven.EndInit();

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

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

            //Button Accept
            BtnAccept.Parent = this;
            BtnAccept.Name = "btnAccept";
            BtnAccept.Text = Language.T("Accept");
            BtnAccept.DialogResult = DialogResult.OK;
            BtnAccept.UseVisualStyleBackColor = true;
        }
示例#3
0
        public Strategy_Properties()
        {
            pnlAveraging         = new Fancy_Panel(Language.T("Handling of Additional Entry Signals"), LayoutColors.ColorSlotCaptionBackAveraging);
            pnlAmounts           = new Fancy_Panel(Language.T("Trading Size"), LayoutColors.ColorSlotCaptionBackAveraging);
            pnlProtection        = new Fancy_Panel(Language.T("Permanent Protection"), LayoutColors.ColorSlotCaptionBackAveraging);
            pnlSmallBalanceChart = new Small_Balance_Chart();

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

            lblSameDirAction = new Label();
            lblOppDirAction  = new Label();

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

            chbPermaSL     = new CheckBox();
            cbxPermaSLType = new ComboBox();
            nudPermaSL     = new NUD();
            chbPermaTP     = new CheckBox();
            cbxPermaTPType = new ComboBox();
            nudPermaTP     = new NUD();

            btnAccept  = new Button();
            btnDefault = new Button();
            btnCancel  = 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.Parent         = this;
            pnlAmounts.Parent           = this;
            pnlProtection.Parent        = this;
            pnlSmallBalanceChart.Parent = this;
            pnlSmallBalanceChart.SetChartData();

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

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

            // 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         = 20;
            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   = true;
            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   = false;
            rbVariableUnits.AutoSize  = false;
            rbVariableUnits.Name      = "rbVariableUnits";
            rbVariableUnits.Text      = Language.T("Trade percent of your account. 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         = 1;
            nudEntryLots.DecimalPlaces = 2;
            nudEntryLots.TextAlign     = HorizontalAlignment.Center;
            nudEntryLots.EndInit();

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

            // 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         = 1;
            nudAddingLots.DecimalPlaces = 2;
            nudAddingLots.TextAlign     = HorizontalAlignment.Center;
            nudAddingLots.EndInit();

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

            // 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.DecimalPlaces = 2;
            nudReducingLots.Value         = 1;
            nudReducingLots.TextAlign     = HorizontalAlignment.Center;
            nudReducingLots.EndInit();

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

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

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

            // NumericUpDown Permanent S/L
            nudPermaSL.Name   = "nudPermaSL";
            nudPermaSL.Parent = pnlProtection;
            nudPermaSL.BeginInit();
            nudPermaSL.Minimum   = 5;
            nudPermaSL.Maximum   = 5000;
            nudPermaSL.Increment = 1;
            nudPermaSL.Value     = (Data.InstrProperties.Digits == 5 || Data.InstrProperties.Digits == 3) ? 1000 : 100;
            nudPermaSL.TextAlign = HorizontalAlignment.Center;
            nudPermaSL.EndInit();

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

            // ComboBox cbxPermaTPType
            cbxPermaTPType.Parent        = pnlProtection;
            cbxPermaTPType.Name          = "cbxPermaTPType";
            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     = (Data.InstrProperties.Digits == 5 || Data.InstrProperties.Digits == 3) ? 1000 : 100;
            nudPermaTP.TextAlign = HorizontalAlignment.Center;
            nudPermaTP.EndInit();

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

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

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

            return;
        }
        public Strategy_Properties()
        {
            pnlAveraging  = new Fancy_Panel(Language.T("Handling of Additional Entry Signals"), LayoutColors.ColorSlotCaptionBackAveraging);
            pnlAmounts    = new Fancy_Panel(Language.T("Trading Size"), LayoutColors.ColorSlotCaptionBackAveraging);
            pnlProtection = new Fancy_Panel(Language.T("Permanent Protection"), LayoutColors.ColorSlotCaptionBackAveraging);
            pnlSmallBalanceChart = new Small_Balance_Chart();

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

            lblSameDirAction = new Label();
            lblOppDirAction  = new Label();

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

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

            btnAccept  = new Button();
            btnDefault = new Button();
            btnCancel  = 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.Parent  = this;
            pnlAmounts.Parent    = this;
            pnlProtection.Parent = this;
            pnlSmallBalanceChart.Parent = this;
            pnlSmallBalanceChart.SetChartData();

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

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

            // 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     = 20;
            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   = true;
            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   = false;
            rbVariableUnits.AutoSize  = false;
            rbVariableUnits.Name      = "rbVariableUnits";
            rbVariableUnits.Text      = Language.T("Trade percent of your account. 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     = 1;
            nudEntryLots.DecimalPlaces = 2;
            nudEntryLots.TextAlign = HorizontalAlignment.Center;
            nudEntryLots.EndInit();

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

            // 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     = 1;
            nudAddingLots.DecimalPlaces = 2;
            nudAddingLots.TextAlign = HorizontalAlignment.Center;
            nudAddingLots.EndInit();

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

            // 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.DecimalPlaces = 2;
            nudReducingLots.Value     = 1;
            nudReducingLots.TextAlign = HorizontalAlignment.Center;
            nudReducingLots.EndInit();

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

            // CheckBox Permanent Stop Loss
            chbPermaSL.Name      = "chbPermaSL";
            chbPermaSL.Parent    = pnlProtection;
            chbPermaSL.ForeColor = colorText;
            chbPermaSL.BackColor = Color.Transparent;
            chbPermaSL.AutoCheck = true;
            chbPermaSL.AutoSize  = true;
            chbPermaSL.Checked   = false;
            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.Name      = "nudPermaSL";
            nudPermaSL.Parent    = pnlProtection;
            nudPermaSL.BeginInit();
            nudPermaSL.Minimum   = 5;
            nudPermaSL.Maximum   = 5000;
            nudPermaSL.Increment = 1;
            nudPermaSL.Value     = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            nudPermaSL.TextAlign = HorizontalAlignment.Center;
            nudPermaSL.EndInit();

            // CheckBox Permanent Take Profit
            chbPermaTP.Name      = "chbPermaTP";
            chbPermaTP.Parent    = pnlProtection;
            chbPermaTP.ForeColor = colorText;
            chbPermaTP.BackColor = Color.Transparent;
            chbPermaTP.AutoCheck = true;
            chbPermaTP.AutoSize  = true;
            chbPermaTP.Checked   = false;
            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     = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            nudPermaTP.TextAlign = HorizontalAlignment.Center;
            nudPermaTP.EndInit();

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

            // NumericUpDown Break Even
            nudBreakEven.Parent    = pnlProtection;
            nudBreakEven.Name      = "nudBreakEven";
            nudBreakEven.BeginInit();
            nudBreakEven.Minimum   = 5;
            nudBreakEven.Maximum   = 5000;
            nudBreakEven.Increment = 1;
            nudBreakEven.Value     = Data.InstrProperties.IsFiveDigits ? 1000 : 100;
            nudBreakEven.TextAlign = HorizontalAlignment.Center;
            nudBreakEven.EndInit();

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

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

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

            return;
        }