Inheritance: System.Windows.Forms.Panel
        /// <summary>
        /// Make a form
        /// </summary>
        public Strategy_Publish()
        {
            pnlBBCodeBase  = new Fancy_Panel();
            pnlInfoBase    = new Fancy_Panel();
            txboxBBCode    = new TextBox();
            lblInformation = new Label();
            btnClose       = new Button();
            btnConnect     = new Button();

            // BBCode_viewer
            AcceptButton = btnClose;
            BackColor    = LayoutColors.ColorFormBack;
            Icon         = Data.Icon;
            Controls.Add(btnConnect);
            Controls.Add(btnClose);
            Controls.Add(pnlBBCodeBase);
            Controls.Add(pnlInfoBase);
            MinimumSize = new System.Drawing.Size(400, 400);
            Text        = Language.T("Publish a Strategy");

            pnlBBCodeBase.Padding = new Padding(4, 4, 2, 2);
            pnlInfoBase.Padding   = new Padding(4, 4, 2, 2);

            // txboxBBCode
            txboxBBCode.Parent        = pnlBBCodeBase;
            txboxBBCode.BorderStyle   = BorderStyle.None;
            txboxBBCode.Dock          = DockStyle.Fill;
            txboxBBCode.BackColor     = LayoutColors.ColorControlBack;
            txboxBBCode.ForeColor     = LayoutColors.ColorControlText;
            txboxBBCode.Multiline     = true;
            txboxBBCode.AcceptsReturn = true;
            txboxBBCode.AcceptsTab    = true;
            txboxBBCode.ScrollBars    = ScrollBars.Vertical;
            txboxBBCode.KeyDown      += new KeyEventHandler(TxboxBBCode_KeyDown);
            txboxBBCode.Text          = Data.Strategy.GenerateBBCode();

            // lblInformation
            lblInformation.Parent    = pnlInfoBase;
            lblInformation.Dock      = DockStyle.Fill;
            lblInformation.BackColor = Color.Transparent;
            lblInformation.ForeColor = LayoutColors.ColorControlText;
            string strInfo = Language.T("Publishing a strategy in the program's forum:") + Environment.NewLine +
                             "1) " + Language.T("Open a new topic in the forum;") + Environment.NewLine +
                             "2) " + Language.T("Copy / Paste the following code;") + Environment.NewLine +
                             "3) " + Language.T("Describe the strategy.");

            lblInformation.Text = strInfo;

            // btnClose
            btnClose.Text   = Language.T("Close");
            btnClose.Click += new System.EventHandler(btnClose_Click);
            btnClose.UseVisualStyleBackColor = true;

            // btnConnect
            btnConnect.Text   = Language.T("Connect to") + " http://forexsb.com/forum";
            btnConnect.Click += new System.EventHandler(btnConnect_Click);
            btnConnect.UseVisualStyleBackColor = true;
        }
        /// <summary>
        /// Make a form
        /// </summary>
        public Strategy_Publish()
        {
            pnlBBCodeBase  = new Fancy_Panel();
            pnlInfoBase    = new Fancy_Panel();
            txboxBBCode    = new TextBox();
            lblInformation = new Label();
            btnClose       = new Button();
            btnConnect     = new Button();

            // BBCode_viewer
            AcceptButton = btnClose;
            BackColor    = LayoutColors.ColorFormBack;
            Icon         = Data.Icon;
            Controls.Add(btnConnect);
            Controls.Add(btnClose);
            Controls.Add(pnlBBCodeBase);
            Controls.Add(pnlInfoBase);
            MinimumSize = new System.Drawing.Size(400, 400);
            Text = Language.T("Publish a Strategy");

            pnlBBCodeBase.Padding = new Padding(4, 4, 2, 2);
            pnlInfoBase.Padding   = new Padding(4, 4, 2, 2);

            // txboxBBCode
            txboxBBCode.Parent        = pnlBBCodeBase;
            txboxBBCode.BorderStyle   = BorderStyle.None;
            txboxBBCode.Dock          = DockStyle.Fill;
            txboxBBCode.BackColor     = LayoutColors.ColorControlBack;
            txboxBBCode.ForeColor     = LayoutColors.ColorControlText;
            txboxBBCode.Multiline     = true;
            txboxBBCode.AcceptsReturn = true;
            txboxBBCode.AcceptsTab    = true;
            txboxBBCode.ScrollBars    = ScrollBars.Vertical;
            txboxBBCode.KeyDown      += new KeyEventHandler(TxboxBBCode_KeyDown);
            txboxBBCode.Text          = Data.Strategy.GenerateBBCode();

            // lblInformation
            lblInformation.Parent      = pnlInfoBase;
            lblInformation.Dock        = DockStyle.Fill;
            lblInformation.BackColor   = Color.Transparent;
            lblInformation.ForeColor   = LayoutColors.ColorControlText;
            string strInfo = Language.T("Publishing a strategy in the program's forum:") + Environment.NewLine +
                "1) " + Language.T("Open a new topic in the forum;") + Environment.NewLine +
                "2) " + Language.T("Copy / Paste the following code;") + Environment.NewLine +
                "3) " + Language.T("Describe the strategy.");
            lblInformation.Text = strInfo;

            // btnClose
            btnClose.Text   = Language.T("Close");
            btnClose.Click += new System.EventHandler(btnClose_Click);
            btnClose.UseVisualStyleBackColor = true;

            // btnConnect
            btnConnect.Text   = Language.T("Connect to") + " http://forexsb.com/forum";
            btnConnect.Click += new System.EventHandler(btnConnect_Click);
            btnConnect.UseVisualStyleBackColor = true;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Public Constructor
        /// </summary>
        public Fancy_Message_Box(string text, string title)
        {
            pnlBase    = new Fancy_Panel();
            pnlControl = new Panel();
            browser    = new WebBrowser();
            btnClose   = new Button();

            Text          = title;
            Icon          = Data.Icon;
            MaximizeBox   = false;
            MinimizeBox   = false;
            ShowInTaskbar = false;
            TopMost       = true;
            AcceptButton  = btnClose;

            pnlBase.Parent = this;

            browser.Parent              = pnlBase;
            browser.AllowNavigation     = false;
            browser.AllowWebBrowserDrop = false;
            browser.DocumentText        = GetText(text, title);
            browser.Dock    = DockStyle.Fill;
            browser.TabStop = false;
            browser.IsWebBrowserContextMenuEnabled = false;
            browser.WebBrowserShortcutsEnabled     = true;

            pnlControl.Parent    = this;
            pnlControl.Dock      = DockStyle.Bottom;
            pnlControl.BackColor = Color.Transparent;

            btnClose.Parent = pnlControl;
            btnClose.Text   = Language.T("Close");
            btnClose.Name   = "Close";
            btnClose.Click += new EventHandler(BtnClose_Click);
            btnClose.UseVisualStyleBackColor = true;
        }
        /// <summary>
        /// Public Constructor
        /// </summary>
        public Fancy_Message_Box(string text, string title)
        {
            pnlBase    = new Fancy_Panel();
            pnlControl = new Panel();
            browser    = new WebBrowser();
            btnClose   = new Button();

            Text          = title;
            Icon          = Data.Icon;
            MaximizeBox   = false;
            MinimizeBox   = false;
            ShowInTaskbar = false;
            TopMost       = true;
            AcceptButton  = btnClose;

            pnlBase.Parent = this;

            browser.Parent              = pnlBase;
            browser.AllowNavigation     = false;
            browser.AllowWebBrowserDrop = false;
            browser.DocumentText        = GetText(text, title);
            browser.Dock                = DockStyle.Fill;
            browser.TabStop             = false;
            browser.IsWebBrowserContextMenuEnabled = false;
            browser.WebBrowserShortcutsEnabled     = true;

            pnlControl.Parent    = this;
            pnlControl.Dock      = DockStyle.Bottom;
            pnlControl.BackColor = Color.Transparent;

            btnClose.Parent = pnlControl;
            btnClose.Text   = Language.T("Close");
            btnClose.Name   = "Close";
            btnClose.Click += new EventHandler(BtnClose_Click);
            btnClose.UseVisualStyleBackColor = true;
        }
        // ---------------------------------------------------------------------------
        /// <summary>
        /// Constructor
        /// </summary>
        public Indicator_Dialog(int slotNumb, SlotTypes slotType, bool isDefined)
        {
            this.slot      = slotNumb;
            this.slotType   = slotType;
            this.isDefined = isDefined;

            if (slotType == SlotTypes.Open)
            {
                slotCation      = Language.T("Opening Point of the Position");
                pnlParameters   = new Fancy_Panel(slotCation, LayoutColors.ColorSlotCaptionBackOpen);
                pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpen);
            }
            else if (slotType == SlotTypes.OpenFilter)
            {
                slotCation      = Language.T("Opening Logic Condition");
                pnlParameters   = new Fancy_Panel(slotCation, LayoutColors.ColorSlotCaptionBackOpenFilter);
                pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpenFilter);
            }
            else if (slotType == SlotTypes.Close)
            {
                slotCation      = Language.T("Closing Point of the Position");
                pnlParameters   = new Fancy_Panel(slotCation, LayoutColors.ColorSlotCaptionBackClose);
                pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackClose);
            }
            else
            {
                slotCation      = Language.T("Closing Logic Condition");
                pnlParameters   = new Fancy_Panel(slotCation, LayoutColors.ColorSlotCaptionBackCloseFilter);
                pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackCloseFilter);
            }

            trvIndicators        = new TreeView();
            pnlSmallBalanceChart = new Small_Balance_Chart();
            btnAccept            = new Button();
            btnHelp              = new Button();
            btnDefault           = new Button();
            btnCancel            = new Button();

            lblIndicatorInfo     = new Label();
            lblIndicatorWarning  = new Label();
            lblIndicator         = new Label();
            lblGroup             = new Label();
            cbxGroup             = new ComboBox();
            aLblList             = new Label[5];
            aCbxList             = new ComboBox[5];
            aLblNumeric          = new Label[6];
            aNudNumeric          = new NUD[6];
            aChbCheck            = new CheckBox[2];

            BackColor            = LayoutColors.ColorFormBack;
            FormBorderStyle      = FormBorderStyle.FixedDialog;
            Icon                 = Data.Icon;
            MaximizeBox          = false;
            MinimizeBox          = false;
            ShowInTaskbar        = false;
            AcceptButton         = btnAccept;
            CancelButton         = btnCancel;
            Text                 = Language.T("Logic and Parameters of the Indicators");

            // Panel TreeViewBase
            pnlTreeViewBase.Parent  = this;
            pnlTreeViewBase.Padding = new Padding(border, (int)pnlTreeViewBase.CaptionHeight, border, border);

            // TreeView trvIndicators
            trvIndicators.Parent      = pnlTreeViewBase;
            trvIndicators.Dock        = DockStyle.Fill;
            trvIndicators.BackColor   = LayoutColors.ColorControlBack;
            trvIndicators.ForeColor   = LayoutColors.ColorControlText;
            trvIndicators.BorderStyle = BorderStyle.None;
            trvIndicators.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(TrvIndicators_NodeMouseDoubleClick);
            trvIndicators.KeyPress   += new KeyPressEventHandler(TrvIndicators_KeyPress);

            pnlParameters.Parent = this;

            // pnlSmallBalanceChart
            pnlSmallBalanceChart.Parent = this;

            // lblIndicatorInfo
            lblIndicatorInfo.Parent          = pnlParameters;
            lblIndicatorInfo.Size            = new Size(16, 16);
            lblIndicatorInfo.BackColor       = Color.Transparent;
            lblIndicatorInfo.BackgroundImage = Properties.Resources.information;
            lblIndicatorInfo.Click          += new EventHandler(LblIndicatorInfo_Click);
            lblIndicatorInfo.MouseEnter     += new EventHandler(Label_MouseEnter);
            lblIndicatorInfo.MouseLeave     += new EventHandler(Label_MouseLeave);

            // lblIndicatorWarning
            lblIndicatorWarning.Parent          = pnlParameters;
            lblIndicatorWarning.Size            = new Size(16, 16);
            lblIndicatorWarning.BackColor       = Color.Transparent;
            lblIndicatorWarning.BackgroundImage = Properties.Resources.warning;
            lblIndicatorWarning.Visible         = false;
            lblIndicatorWarning.Click          += new EventHandler(LblIndicatorWarning_Click);
            lblIndicatorWarning.MouseEnter     += new EventHandler(Label_MouseEnter);
            lblIndicatorWarning.MouseLeave     += new EventHandler(Label_MouseLeave);

            // Label Indicator
            lblIndicator.Parent    = pnlParameters;
            lblIndicator.TextAlign = ContentAlignment.MiddleCenter;
            lblIndicator.Font      = new Font(Font.FontFamily, 14, FontStyle.Bold);
            lblIndicator.ForeColor = LayoutColors.ColorSlotIndicatorText;
            lblIndicator.BackColor = Color.Transparent;

            // Label aLblList[0]
            aLblList[0]           = new Label();
            aLblList[0].Parent    = pnlParameters;
            aLblList[0].TextAlign = ContentAlignment.BottomCenter;
            aLblList[0].ForeColor = LayoutColors.ColorControlText;
            aLblList[0].BackColor = Color.Transparent;

            // ComboBox aCbxList[0]
            aCbxList[0]               = new ComboBox();
            aCbxList[0].Parent        = pnlParameters;
            aCbxList[0].DropDownStyle = ComboBoxStyle.DropDownList;
            aCbxList[0].SelectedIndexChanged  += new EventHandler(Param_Changed);

            // Logical Group
            lblGroup = new Label();
            lblGroup.Parent    = pnlParameters;
            lblGroup.TextAlign = ContentAlignment.BottomCenter;
            lblGroup.ForeColor = LayoutColors.ColorControlText;
            lblGroup.BackColor = Color.Transparent;
            lblGroup.Text      = Language.T("Group");

            cbxGroup = new ComboBox();
            cbxGroup.Parent  = pnlParameters;
            if(slotType == SlotTypes.OpenFilter)
                cbxGroup.Items.AddRange(new string[] {"A", "B", "C", "D", "E", "F", "G", "H", "All"});
            if(slotType == SlotTypes.CloseFilter)
                cbxGroup.Items.AddRange(new string[] {"a", "b", "c", "d", "e", "f", "g", "h", "all"});
            cbxGroup.SelectedIndexChanged += new EventHandler(Group_Changed);
            cbxGroup.DropDownStyle = ComboBoxStyle.DropDownList;
            toolTip.SetToolTip(cbxGroup, Language.T("The logical group of the slot."));

            // ListParams
            for (int i = 1; i < 5; i++)
            {
                aLblList[i] = new Label();
                aLblList[i].Parent    = pnlParameters;
                aLblList[i].TextAlign = ContentAlignment.BottomCenter;
                aLblList[i].ForeColor = LayoutColors.ColorControlText;
                aLblList[i].BackColor = Color.Transparent;

                aCbxList[i]               = new ComboBox();
                aCbxList[i].Parent        = pnlParameters;
                aCbxList[i].Enabled       = false;
                aCbxList[i].SelectedIndexChanged += new EventHandler(Param_Changed);
                aCbxList[i].DropDownStyle = ComboBoxStyle.DropDownList;
            }

            // NumParams
            for (int i = 0; i < 6; i++)
            {
                aLblNumeric[i] = new Label();
                aLblNumeric[i].Parent    = pnlParameters;
                aLblNumeric[i].TextAlign = ContentAlignment.MiddleRight;
                aLblNumeric[i].ForeColor = LayoutColors.ColorControlText;
                aLblNumeric[i].BackColor = Color.Transparent;

                aNudNumeric[i] = new NUD();
                aNudNumeric[i].Parent        = pnlParameters;
                aNudNumeric[i].TextAlign     = HorizontalAlignment.Center;
                aNudNumeric[i].Enabled       = false;
                aNudNumeric[i].ValueChanged += new EventHandler(Param_Changed);
            }

            // CheckParams
            for (int i = 0; i < 2; i++)
            {
                aChbCheck[i]                 = new CheckBox();
                aChbCheck[i].Parent          = pnlParameters;
                aChbCheck[i].CheckAlign      = ContentAlignment.MiddleLeft;
                aChbCheck[i].TextAlign       = ContentAlignment.MiddleLeft;
                aChbCheck[i].CheckedChanged += new EventHandler(Param_Changed);
                aChbCheck[i].ForeColor       = LayoutColors.ColorControlText;
                aChbCheck[i].BackColor       = Color.Transparent;
                aChbCheck[i].Enabled         = false;
            }

            //Button Accept
            btnAccept.Parent       = this;
            btnAccept.Text         = Language.T("Accept");
            btnAccept.DialogResult = DialogResult.OK;
            btnAccept.Click       += new EventHandler(BtnOk_Click);
            btnAccept.UseVisualStyleBackColor = true;

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

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

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

            SetTreeViewIndicators();

            // ComboBoxindicator index selection.
            if (isDefined)
            {
                TreeNode [] atrn = trvIndicators.Nodes.Find(Data.Strategy.Slot[slot].IndParam.IndicatorName, true);
                trvIndicators.SelectedNode = atrn[0];
                UpdateFromIndicatorParam(Data.Strategy.Slot[slot].IndParam);
                SetLogicalGroup();
                CalculateIndicator(false);
                pnlSmallBalanceChart.SetChartData();
                pnlSmallBalanceChart.InitChart();
                pnlSmallBalanceChart.Invalidate();
            }
            else
            {
                string defaultIndicator;
                if (slotType == SlotTypes.Open)
                    defaultIndicator = "Bar Opening";
                else if (slotType == SlotTypes.OpenFilter)
                    defaultIndicator = "Accelerator Oscillator";
                else if (slotType == SlotTypes.Close)
                    defaultIndicator = "Bar Closing";
                else
                    defaultIndicator = "Accelerator Oscillator";

                TreeNode[] atrn = trvIndicators.Nodes.Find(defaultIndicator, true);
                trvIndicators.SelectedNode = atrn[0];
                TrvIndicatorsLoadIndicator(atrn[0]);
            }

            oppSignalBehaviour = Data.Strategy.OppSignalAction;

            if (slotType == SlotTypes.Close && Data.Strategy.CloseFilters > 0)
                for (int iSlot = Data.Strategy.CloseSlot + 1; iSlot < Data.Strategy.Slots; iSlot++)
                    closingConditions.Add(Data.Strategy.Slot[iSlot].Clone());

            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;
        }
Ejemplo 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;
        }
Ejemplo n.º 8
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);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public New_Translation()
        {
            // The form
            MaximizeBox     = false;
            MinimizeBox     = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Text            = Language.T("New Translation");

            // Controls
            pnlInput        = new Fancy_Panel(Language.T("Common Parameters"));
            alblInputNames  = new Label[5];
            atbxInputValues = new TextBox[5];
            btnAccept       = new Button();
            btnCancel       = new Button();

            // Input
            pnlInput.Parent = this;

            // Input Names
            string[] asInputNames = new string[] {
                Language.T("Language"),
                Language.T("File name"),
                Language.T("Author"),
                Language.T("Website"),
                Language.T("Contacts"),
            };

            // Input Values
            string[] asInputValues = new string[] {
                "Language",
                "Language",
                "Your Name",
                "http://forexsb.com",
                "*****@*****.**",
            };

            // Input parameters
            for (int i = 0; i < asInputNames.Length;  i++)
            {
                alblInputNames[i] = new Label();
                alblInputNames[i].Parent    = pnlInput;
                alblInputNames[i].ForeColor = LayoutColors.ColorControlText;
                alblInputNames[i].BackColor = Color.Transparent;
                alblInputNames[i].AutoSize  = true;
                alblInputNames[i].Text      = asInputNames[i];

                atbxInputValues[i] = new TextBox();
                atbxInputValues[i].Parent = pnlInput;
                atbxInputValues[i].Text   = asInputValues[i];
            }

            //Button Cancel
            btnCancel.Parent       = this;
            btnCancel.Text         = Language.T("Cancel");
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.Click       += new EventHandler(Btn_Click);
            btnCancel.UseVisualStyleBackColor = true;

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

            return;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Edit_Translation()
        {
            // The form
            MaximizeBox     = false;
            MinimizeBox     = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Text            = Language.T("Edit Translation");
            FormClosing    += new FormClosingEventHandler(Actions_FormClosing);

            // Controls
            pnlCommon       = new Fancy_Panel(Language.T("Common Parameters"));
            pnlPhrases      = new Fancy_Panel(Language.T("English Phrase - Translated Phrase"));
            alblInputNames  = new Label[5];
            atbxInputValues = new TextBox[5];
            atbxMain        = new TextBox[TEXTBOXES];
            atbxAlt         = new TextBox[TEXTBOXES];
            scrollBar       = new VScrollBar();
            tbxSearch       = new TextBox();
            btnSearch       = new Button();
            btnUntranslated = new Button();
            btnAccept       = new Button();
            btnCancel       = new Button();

            // Common
            pnlCommon.Parent = this;

            // Phrases
            pnlPhrases.Parent = this;

            // Input Names
            string[] asInputNames = new string[] {
                Language.T("Language"),
                Language.T("File name"),
                Language.T("Author"),
                Language.T("Website"),
                Language.T("Contacts"),
            };

            // Input Values
            string[] asInputValues = new string[] {
                Configs.Language,
                Language.LanguageFileName,
                Language.Author,
                Language.AuthorsWebsite,
                Language.AuthorsEmail,
            };

            // Common parameters
            for (int i = 0; i < asInputNames.Length; i++)
            {
                alblInputNames[i]           = new Label();
                alblInputNames[i].Parent    = pnlCommon;
                alblInputNames[i].ForeColor = LayoutColors.ColorControlText;
                alblInputNames[i].BackColor = Color.Transparent;
                alblInputNames[i].AutoSize  = true;
                alblInputNames[i].Text      = asInputNames[i];

                atbxInputValues[i]        = new TextBox();
                atbxInputValues[i].Parent = pnlCommon;
                atbxInputValues[i].Text   = asInputValues[i];
            }

            // Phrases
            for (int i = 0; i < TEXTBOXES; i++)
            {
                atbxMain[i]           = new TextBox();
                atbxMain[i].Parent    = pnlPhrases;
                atbxMain[i].Multiline = true;
                atbxMain[i].ReadOnly  = true;
                atbxMain[i].ForeColor = Color.DarkGray;

                atbxAlt[i]              = new TextBox();
                atbxAlt[i].Parent       = pnlPhrases;
                atbxAlt[i].Multiline    = true;
                atbxAlt[i].Tag          = i;
                atbxAlt[i].TextChanged += new EventHandler(Edit_Translation_TextChanged);
            }

            // Vertical ScrollBar
            scrollBar.Parent        = pnlPhrases;
            scrollBar.Visible       = true;
            scrollBar.Enabled       = true;
            scrollBar.ValueChanged += new EventHandler(ScrollBar_ValueChanged);
            scrollBar.TabStop       = true;

            // TextBox Search
            tbxSearch.Parent       = this;
            tbxSearch.TextChanged += new EventHandler(TbxSearch_TextChanged);

            // Button Search
            btnSearch.Parent = this;
            btnSearch.Name   = "Search";
            btnSearch.Text   = Language.T("Search");
            btnSearch.Click += new EventHandler(Btn_Click);
            btnSearch.UseVisualStyleBackColor = true;

            // Button Untranslated
            btnUntranslated.Parent = this;
            btnUntranslated.Name   = "Untranslated";
            btnUntranslated.Text   = Language.T("Not Translated");
            btnUntranslated.Click += new EventHandler(Btn_Click);
            btnUntranslated.UseVisualStyleBackColor = true;

            // Button Cancel
            btnCancel.Parent                  = this;
            btnCancel.Name                    = "Cancel";
            btnCancel.Text                    = Language.T("Cancel");
            btnCancel.DialogResult            = DialogResult.Cancel;
            btnCancel.Click                  += new EventHandler(Btn_Click);
            btnCancel.UseVisualStyleBackColor = true;

            // Button Accept
            btnAccept.Parent                  = this;
            btnAccept.Name                    = "Accept";
            btnAccept.Text                    = Language.T("Accept");
            btnAccept.DialogResult            = DialogResult.OK;
            btnAccept.Click                  += new EventHandler(Btn_Click);
            btnAccept.Enabled                 = false;
            btnAccept.UseVisualStyleBackColor = true;
        }
        /// <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;
        }
        public AboutScreen()
        {
            pnlBase     = new Fancy_Panel();
            label1      = new Label();
            label2      = new Label();
            label3      = new Label();
            label4      = new Label();
            label5      = new Label();
            label6      = new Label();
            pictureBox1 = new PictureBox();
            llWebsite   = new LinkLabel();
            llForum     = new LinkLabel();
            llEmail     = new LinkLabel();
            btnOk       = new Button();

            // Panel Base
            pnlBase.Parent = this;

            // pictureBox1
            pictureBox1.TabStop   = false;
            pictureBox1.BackColor = Color.Transparent;
            pictureBox1.Image     = Properties.Resources.Logo;

            // label1
            label1.AutoSize  = true;
            label1.Font      = new Font("Microsoft Sans Serif", 16F, FontStyle.Bold);
            label1.ForeColor = LayoutColors.ColorControlText;
            label1.BackColor = Color.Transparent;
            label1.Text      = Data.ProgramName;

            string stage = String.Empty;

            if (Data.IsProgramBeta)
            {
                stage = " " + Language.T("Beta");
            }
            else if (Data.IsProgramRC)
            {
                stage = " " + "RC";
            }

            // label2
            label2.AutoSize  = true;
            label2.Font      = new Font("Microsoft Sans Serif", 12F);
            label2.ForeColor = LayoutColors.ColorControlText;
            label2.BackColor = Color.Transparent;
            label2.Text      = Language.T("Version") + ": " + Data.ProgramVersion + stage;

            // label3
            label3.AutoSize  = true;
            label3.Font      = new Font("Microsoft Sans Serif", 10F);
            label3.ForeColor = LayoutColors.ColorControlText;
            label3.BackColor = Color.Transparent;
            label3.Text      = "Copyright (c) 2006 - 2011 Miroslav Popov" + Environment.NewLine + Language.T("Distributor") +
                               " - Forex Software Ltd." + Environment.NewLine + Environment.NewLine + Language.T("This is a freeware program!");

            // label4
            label4.AutoSize  = true;
            label4.ForeColor = LayoutColors.ColorControlText;
            label4.BackColor = Color.Transparent;
            label4.Text      = Language.T("Website") + ":";

            // label5
            label5.AutoSize  = true;
            label5.ForeColor = LayoutColors.ColorControlText;
            label5.BackColor = Color.Transparent;
            label5.Text      = Language.T("Support forum") + ":";

            // label6
            label6.AutoSize  = true;
            label6.ForeColor = LayoutColors.ColorControlText;
            label6.BackColor = Color.Transparent;
            label6.Text      = Language.T("Contacts") + ":";

            // llWebsite
            llWebsite.AutoSize     = true;
            llWebsite.TabStop      = true;
            llWebsite.BackColor    = Color.Transparent;
            llWebsite.Text         = "http://forexsb.com";
            llWebsite.LinkClicked += new LinkLabelLinkClickedEventHandler(llWebsite_LinkClicked);

            // llForum
            llForum.AutoSize     = true;
            llForum.TabStop      = true;
            llForum.BackColor    = Color.Transparent;
            llForum.Text         = "http://forexsb.com/forum";
            llForum.LinkClicked += new LinkLabelLinkClickedEventHandler(llForum_LinkClicked);

            // llEmail
            llEmail.AutoSize     = true;
            llEmail.TabStop      = true;
            llEmail.BackColor    = Color.Transparent;
            llEmail.Text         = "*****@*****.**";
            llEmail.LinkClicked += new LinkLabelLinkClickedEventHandler(llEmail_LinkClicked);

            // Button Base
            btnOk.Parent = this;
            btnOk.Text   = Language.T("Ok");
            btnOk.UseVisualStyleBackColor = true;
            btnOk.Click += new EventHandler(btnOk_Click);

            // AboutScreen
            pnlBase.Controls.Add(label1);
            pnlBase.Controls.Add(label2);
            pnlBase.Controls.Add(label3);
            pnlBase.Controls.Add(label4);
            pnlBase.Controls.Add(label5);
            pnlBase.Controls.Add(label6);
            pnlBase.Controls.Add(llEmail);
            pnlBase.Controls.Add(llForum);
            pnlBase.Controls.Add(llWebsite);
            pnlBase.Controls.Add(pictureBox1);

            StartPosition   = FormStartPosition.CenterScreen;
            Text            = Language.T("About") + " " + Data.ProgramName;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            BackColor       = LayoutColors.ColorFormBack;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            ClientSize      = new Size(360, 280);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Pivot_Points_Calculator()
        {
            pnlInput  = new Fancy_Panel(Language.T("Input Values"));
            pnlOutput = new Fancy_Panel(Language.T("Output Values"));

            alblInputNames   = new Label[3];
            atbxInputValues  = new TextBox[3];
            alblOutputNames  = new Label[7];
            alblOutputValues = new Label[7];

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

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

            // Input
            pnlInput.Parent = this;

            // Output
            pnlOutput.Parent = this;

            // Input Names
            string[] asInputNames = new string[] {
                Language.T("Highest price"),
                Language.T("Closing price"),
                Language.T("Lowest price"),
            };

            int iNumber = 0;

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

                atbxInputValues[iNumber]              = new TextBox();
                atbxInputValues[iNumber].Parent       = pnlInput;
                atbxInputValues[iNumber].TextChanged += new EventHandler(TbxInput_TextChanged);
                iNumber++;
            }

            // Output Names
            string[] asOutputNames = new string[] {
                Language.T("Resistance") + " 3",
                Language.T("Resistance") + " 2",
                Language.T("Resistance") + " 1",
                Language.T("Pivot Point"),
                Language.T("Support") + " 1",
                Language.T("Support") + " 2",
                Language.T("Support") + " 3",
            };

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

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

                iNumber++;
            }

            alblOutputNames[3].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[3].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Edit_Translation()
        {
            // The form
            MaximizeBox     = false;
            MinimizeBox     = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Text            = Language.T("Edit Translation");
            FormClosing    += new FormClosingEventHandler(Actions_FormClosing);

            // Controls
            pnlCommon       = new Fancy_Panel(Language.T("Common Parameters"));
            pnlPhrases      = new Fancy_Panel(Language.T("English Phrase - Translated Phrase"));
            alblInputNames  = new Label[5];
            atbxInputValues = new TextBox[5];
            atbxMain        = new TextBox[TEXTBOXES];
            atbxAlt         = new TextBox[TEXTBOXES];
            scrollBar      = new VScrollBar();
            tbxSearch       = new TextBox();
            btnSearch       = new Button();
            btnUntranslated = new Button();
            btnAccept       = new Button();
            btnCancel       = new Button();

            // Common
            pnlCommon.Parent = this;

            // Phrases
            pnlPhrases.Parent = this;

            // Input Names
            string[] asInputNames = new string[] {
                Language.T("Language"),
                Language.T("File name"),
                Language.T("Author"),
                Language.T("Website"),
                Language.T("Contacts"),
            };

            // Input Values
            string[] asInputValues = new string[] {
                Configs.Language,
                Language.LanguageFileName,
                Language.Author,
                Language.AuthorsWebsite,
                Language.AuthorsEmail,
            };

            // Common parameters
            for (int i = 0; i < asInputNames.Length;  i++)
            {
                alblInputNames[i] = new Label();
                alblInputNames[i].Parent    = pnlCommon;
                alblInputNames[i].ForeColor = LayoutColors.ColorControlText;
                alblInputNames[i].BackColor = Color.Transparent;
                alblInputNames[i].AutoSize  = true;
                alblInputNames[i].Text      = asInputNames[i];

                atbxInputValues[i] = new TextBox();
                atbxInputValues[i].Parent = pnlCommon;
                atbxInputValues[i].Text   = asInputValues[i];
            }

            // Phrases
            for (int i = 0; i < TEXTBOXES; i++)
            {
                atbxMain[i] = new TextBox();
                atbxMain[i].Parent    = pnlPhrases;
                atbxMain[i].Multiline = true;
                atbxMain[i].ReadOnly  = true;
                atbxMain[i].ForeColor = Color.DarkGray;

                atbxAlt[i] = new TextBox();
                atbxAlt[i].Parent    = pnlPhrases;
                atbxAlt[i].Multiline = true;
                atbxAlt[i].Tag       = i;
                atbxAlt[i].TextChanged += new EventHandler(Edit_Translation_TextChanged);
            }

            // Vertical ScrollBar
            scrollBar.Parent  = pnlPhrases;
            scrollBar.Visible = true;
            scrollBar.Enabled = true;
            scrollBar.ValueChanged += new EventHandler(ScrollBar_ValueChanged);
            scrollBar.TabStop = true;

            // TextBox Search
            tbxSearch.Parent = this;
            tbxSearch.TextChanged += new EventHandler(TbxSearch_TextChanged);

            // Button Search
            btnSearch.Parent = this;
            btnSearch.Name   = "Search";
            btnSearch.Text   = Language.T("Search");
            btnSearch.Click += new EventHandler(Btn_Click);
            btnSearch.UseVisualStyleBackColor = true;

            // Button Untranslated
            btnUntranslated.Parent = this;
            btnUntranslated.Name   = "Untranslated";
            btnUntranslated.Text   = Language.T("Not Translated");
            btnUntranslated.Click += new EventHandler(Btn_Click);
            btnUntranslated.UseVisualStyleBackColor = true;

            // Button Cancel
            btnCancel.Parent       = this;
            btnCancel.Name         = "Cancel";
            btnCancel.Text         = Language.T("Cancel");
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.Click       += new EventHandler(Btn_Click);
            btnCancel.UseVisualStyleBackColor = true;

            // Button Accept
            btnAccept.Parent       = this;
            btnAccept.Name         = "Accept";
            btnAccept.Text         = Language.T("Accept");
            btnAccept.DialogResult = DialogResult.OK;
            btnAccept.Click       += new EventHandler(Btn_Click);
            btnAccept.Enabled      = false;
            btnAccept.UseVisualStyleBackColor = true;
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Constructor
        /// </summary>
        public New_Translation()
        {
            // The form
            MaximizeBox     = false;
            MinimizeBox     = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Text            = Language.T("New Translation");

            // Controls
            pnlInput        = new Fancy_Panel(Language.T("Common Parameters"));
            alblInputNames  = new Label[5];
            atbxInputValues = new TextBox[5];
            btnAccept       = new Button();
            btnCancel       = new Button();

            // Input
            pnlInput.Parent = this;

            // Input Names
            string[] asInputNames = new string[] {
                Language.T("Language"),
                Language.T("File name"),
                Language.T("Author"),
                Language.T("Website"),
                Language.T("Contacts"),
            };

            // Input Values
            string[] asInputValues = new string[] {
                "Language",
                "Language",
                "Your Name",
                "http://forexsb.com",
                "*****@*****.**",
            };

            // Input parameters
            for (int i = 0; i < asInputNames.Length; i++)
            {
                alblInputNames[i]           = new Label();
                alblInputNames[i].Parent    = pnlInput;
                alblInputNames[i].ForeColor = LayoutColors.ColorControlText;
                alblInputNames[i].BackColor = Color.Transparent;
                alblInputNames[i].AutoSize  = true;
                alblInputNames[i].Text      = asInputNames[i];

                atbxInputValues[i]        = new TextBox();
                atbxInputValues[i].Parent = pnlInput;
                atbxInputValues[i].Text   = asInputValues[i];
            }

            //Button Cancel
            btnCancel.Parent                  = this;
            btnCancel.Text                    = Language.T("Cancel");
            btnCancel.DialogResult            = DialogResult.Cancel;
            btnCancel.Click                  += new EventHandler(Btn_Click);
            btnCancel.UseVisualStyleBackColor = true;

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

            return;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Fibonacci_Levels_Calculator()
        {
            pnlInput  = new Fancy_Panel(Language.T("Input Values"));
            pnlOutput = new Fancy_Panel(Language.T("Output Values"));

            alblInputNames   = new Label[2];
            atbxInputValues  = new TextBox[2];
            alblOutputNames  = new Label[10];
            alblOutputValues = new Label[10];

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

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

            // Input
            pnlInput.Parent= this;

            // Output
            pnlOutput.Parent= this;

            // Input Names
            string[] asInputNames = new string[] {
                Language.T("First price"),
                Language.T("Second price"),
            };

            int number = 0;
            foreach (string sName 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      = sName;

                atbxInputValues[number] = new TextBox();
                atbxInputValues[number].Parent = pnlInput;
                atbxInputValues[number].TextChanged += new EventHandler(TbxInput_TextChanged);
                number++;
            }

            // Output Names

            number = 0;
            foreach (float fn in afLevels)
            {
                alblOutputNames[number] = new Label();
                alblOutputNames[number].Parent    = pnlOutput;
                alblOutputNames[number].ForeColor = colorText;
                alblOutputNames[number].BackColor = Color.Transparent;
                alblOutputNames[number].AutoSize  = true;
                alblOutputNames[number].Text      = fn.ToString("F1") + " %";

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

                number++;
            }

            alblOutputNames[2].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputNames[3].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputNames[4].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[2].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[3].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[4].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
        }
        /// <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;
        }
        public AboutScreen()
        {
            pnlBase = new Fancy_Panel();
            label1  = new Label();
            label2  = new Label();
            label3  = new Label();
            label4  = new Label();
            label5  = new Label();
            label6  = new Label();
            pictureBox1 = new PictureBox();
            llWebsite   = new LinkLabel();
            llForum     = new LinkLabel();
            llEmail     = new LinkLabel();
            btnOk       = new Button();

            // Panel Base
            pnlBase.Parent = this;

            // pictureBox1
            pictureBox1.TabStop   = false;
            pictureBox1.BackColor = Color.Transparent;
            pictureBox1.Image     = Properties.Resources.Logo;

            // label1
            label1.AutoSize  = true;
            label1.Font      = new Font("Microsoft Sans Serif", 16F, FontStyle.Bold);
            label1.ForeColor = LayoutColors.ColorControlText;
            label1.BackColor = Color.Transparent;
            label1.Text      = Data.ProgramName;

            string stage = String.Empty;
            if (Data.IsProgramBeta)
                stage = " " + Language.T("Beta");
            else if (Data.IsProgramRC)
                stage = " " + "RC";

            // label2
            label2.AutoSize  = true;
            label2.Font      = new Font("Microsoft Sans Serif", 12F);
            label2.ForeColor = LayoutColors.ColorControlText;
            label2.BackColor = Color.Transparent;
            label2.Text      = Language.T("Version") + ": " + Data.ProgramVersion + stage;

            // label3
            label3.AutoSize  = true;
            label3.Font      = new Font("Microsoft Sans Serif", 10F);
            label3.ForeColor = LayoutColors.ColorControlText;
            label3.BackColor = Color.Transparent;
            label3.Text      = "Copyright (c) 2006 - 2011 Miroslav Popov" + Environment.NewLine + Language.T("Distributor") +
                               " - Forex Software Ltd." + Environment.NewLine + Environment.NewLine + Language.T("This is a freeware program!");

            // label4
            label4.AutoSize  = true;
            label4.ForeColor = LayoutColors.ColorControlText;
            label4.BackColor = Color.Transparent;
            label4.Text      = Language.T("Website") + ":";

            // label5
            label5.AutoSize  = true;
            label5.ForeColor = LayoutColors.ColorControlText;
            label5.BackColor = Color.Transparent;
            label5.Text      = Language.T("Support forum") + ":";

            // label6
            label6.AutoSize  = true;
            label6.ForeColor = LayoutColors.ColorControlText;
            label6.BackColor = Color.Transparent;
            label6.Text      = Language.T("Contacts") + ":";

            // llWebsite
            llWebsite.AutoSize  = true;
            llWebsite.TabStop   = true;
            llWebsite.BackColor = Color.Transparent;
            llWebsite.Text      = "http://forexsb.com";
            llWebsite.LinkClicked += new LinkLabelLinkClickedEventHandler(llWebsite_LinkClicked);

            // llForum
            llForum.AutoSize     = true;
            llForum.TabStop      = true;
            llForum.BackColor    = Color.Transparent;
            llForum.Text         = "http://forexsb.com/forum";
            llForum.LinkClicked += new LinkLabelLinkClickedEventHandler(llForum_LinkClicked);

            // llEmail
            llEmail.AutoSize     = true;
            llEmail.TabStop      = true;
            llEmail.BackColor    = Color.Transparent;
            llEmail.Text         = "*****@*****.**";
            llEmail.LinkClicked += new LinkLabelLinkClickedEventHandler(llEmail_LinkClicked);

            // Button Base
            btnOk.Parent = this;
            btnOk.Text   = Language.T("Ok");
            btnOk.UseVisualStyleBackColor = true;
            btnOk.Click += new EventHandler(btnOk_Click);

            // AboutScreen
            pnlBase.Controls.Add(label1);
            pnlBase.Controls.Add(label2);
            pnlBase.Controls.Add(label3);
            pnlBase.Controls.Add(label4);
            pnlBase.Controls.Add(label5);
            pnlBase.Controls.Add(label6);
            pnlBase.Controls.Add(llEmail);
            pnlBase.Controls.Add(llForum);
            pnlBase.Controls.Add(llWebsite);
            pnlBase.Controls.Add(pictureBox1);

            StartPosition   = FormStartPosition.CenterScreen;
            Text            = Language.T("About") + " " + Data.ProgramName;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            BackColor       = LayoutColors.ColorFormBack;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            ClientSize      = new Size(360, 280);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Data_Horizon(int iMaxBars, DateTime dtStart, DateTime dtEnd, bool bUseStartDate, bool bUseEndDate)
        {
            this.maxBars      = iMaxBars;
            this.dtStart      = dtStart;
            this.dtEnd        = dtEnd;
            this.useEndDate   = bUseEndDate;
            this.useStartDate = bUseStartDate;

            btnAccept         = new Button();
            btnHelp           = new Button();
            btnCancel         = new Button();
            pnlBase           = new Fancy_Panel();
            dtpStartDate      = new DateTimePicker();
            dtpEndDate        = new DateTimePicker();
            chboxUseEndDate   = new CheckBox();
            chboxUseStartDate = new CheckBox();
            numUpDownMaxBars  = new NumericUpDown();
            lblMaxBars        = new Label();
            lblMinBars        = new Label();

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

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

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

            //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 pnlBase
            pnlBase.Parent = this;

            // chboxUseEndDate
            chboxUseEndDate.Parent             = pnlBase;
            chboxUseEndDate.ForeColor          = LayoutColors.ColorControlText;
            chboxUseEndDate.BackColor          = Color.Transparent;
            chboxUseEndDate.AutoSize           = true;
            chboxUseEndDate.Text               = Language.T("Remove data newer than:");
            chboxUseEndDate.CheckStateChanged += new EventHandler(chboxUseEndDate_CheckStateChanged);
            toolTip.SetToolTip(chboxUseEndDate, Language.T("All data newer than the specified date will be cut out."));

            // chboxUseStartDate
            chboxUseStartDate.Parent             = pnlBase;
            chboxUseStartDate.AutoSize           = true;
            chboxUseStartDate.ForeColor          = LayoutColors.ColorControlText;
            chboxUseStartDate.BackColor          = Color.Transparent;
            chboxUseStartDate.Text               = Language.T("Remove data older than:");
            chboxUseStartDate.CheckStateChanged += new EventHandler(chboxUseStartDate_CheckStateChanged);
            toolTip.SetToolTip(chboxUseStartDate, Language.T("All data older than the specified date will be cut out."));

            // Start Date
            dtpStartDate.Parent        = pnlBase;
            dtpStartDate.ForeColor     = LayoutColors.ColorControlText;
            dtpStartDate.ShowUpDown    = true;
            dtpStartDate.ValueChanged += new EventHandler(dtpStartDate_ValueChanged);

            // End Date
            dtpEndDate.Parent        = pnlBase;
            dtpEndDate.ForeColor     = LayoutColors.ColorControlText;
            dtpEndDate.ShowUpDown    = true;
            dtpEndDate.ValueChanged += new EventHandler(dtpEndDate_ValueChanged);

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

            // numUpDownMaxBars
            numUpDownMaxBars.BeginInit();
            numUpDownMaxBars.Parent             = pnlBase;
            numUpDownMaxBars.Name               = "MaxBars";
            numUpDownMaxBars.Minimum            = Configs.MIN_BARS;
            numUpDownMaxBars.Maximum            = Configs.MAX_BARS;
            numUpDownMaxBars.ThousandsSeparator = true;
            numUpDownMaxBars.ValueChanged      += new EventHandler(numUpDown_ValueChanged);
            numUpDownMaxBars.TextAlign          = HorizontalAlignment.Center;
            numUpDownMaxBars.EndInit();

            //lblMinBars
            lblMinBars.Parent    = pnlBase;
            lblMinBars.AutoSize  = true;
            lblMinBars.ForeColor = LayoutColors.ColorControlText;
            lblMinBars.BackColor = Color.Transparent;
            lblMinBars.Text      = Language.T("Minimum number of bars:") + " " + Configs.MIN_BARS.ToString();
            lblMinBars.TextAlign = ContentAlignment.MiddleLeft;
        }
        /// <summary>
        /// Public Constructor
        /// </summary>
        public Starting_Tips()
        {
            pnlBase    = new Fancy_Panel();
            pnlControl = new Panel();
            browser    = new WebBrowser();
            chboxShow  = new CheckBox();
            btnNextTip = new Button();
            btnPrevTip = new Button();
            btnClose   = new Button();

            xmlTips = new XmlDocument();
            rnd     = new Random();

            Text            = Language.T("Tip of the Day");
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Icon            = Data.Icon;
            MaximizeBox     = false;
            MinimizeBox     = false;
            TopMost         = true;

            pnlBase.Parent = this;

            browser.Parent              = pnlBase;
            browser.AllowNavigation     = true;
            browser.AllowWebBrowserDrop = false;
            browser.DocumentText        = Language.T("Loading...");
            browser.Dock                = DockStyle.Fill;
            browser.TabStop             = false;
            browser.DocumentCompleted  += new WebBrowserDocumentCompletedEventHandler(Browser_DocumentCompleted);
            browser.IsWebBrowserContextMenuEnabled = false;
            browser.WebBrowserShortcutsEnabled = false;

            pnlControl.Parent    = this;
            pnlControl.Dock      = DockStyle.Bottom;
            pnlControl.BackColor = Color.Transparent;

            chboxShow.Parent    = pnlControl;
            chboxShow.Text      = Language.T("Show a tip");
            chboxShow.Checked   = Configs.ShowStartingTip;
            chboxShow.TextAlign = ContentAlignment.MiddleLeft;
            chboxShow.AutoSize  = true;
            chboxShow.ForeColor = LayoutColors.ColorControlText;
            chboxShow.CheckStateChanged += new EventHandler(ChboxShow_CheckStateChanged);

            btnNextTip.Parent   = pnlControl;
            btnNextTip.Text     = Language.T("Next Tip");
            btnNextTip.Name     = "Next";
            btnNextTip.Click   += new EventHandler(Navigate);
            btnNextTip.UseVisualStyleBackColor = true;

            btnPrevTip.Parent   = pnlControl;
            btnPrevTip.Text     = Language.T("Previous Tip");
            btnPrevTip.Name     = "Previous";
            btnPrevTip.Click   += new EventHandler(Navigate);
            btnPrevTip.UseVisualStyleBackColor = true;

            btnClose.Parent = pnlControl;
            btnClose.Text   = Language.T("Close");
            btnClose.Name   = "Close";
            btnClose.Click += new EventHandler(Navigate);
            btnClose.UseVisualStyleBackColor = true;

            LoadStartingTips();

            return;
        }
        /// <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;
        }
        /// <summary>
        /// Public Constructor
        /// </summary>
        public Starting_Tips()
        {
            pnlBase    = new Fancy_Panel();
            pnlControl = new Panel();
            browser    = new WebBrowser();
            chboxShow  = new CheckBox();
            btnNextTip = new Button();
            btnPrevTip = new Button();
            btnClose   = new Button();

            xmlTips = new XmlDocument();
            rnd     = new Random();

            Text            = Language.T("Tip of the Day");
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Icon            = Data.Icon;
            MaximizeBox     = false;
            MinimizeBox     = false;
            TopMost         = true;

            pnlBase.Parent = this;

            browser.Parent              = pnlBase;
            browser.AllowNavigation     = true;
            browser.AllowWebBrowserDrop = false;
            browser.DocumentText        = Language.T("Loading...");
            browser.Dock               = DockStyle.Fill;
            browser.TabStop            = false;
            browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(Browser_DocumentCompleted);
            browser.IsWebBrowserContextMenuEnabled = false;
            browser.WebBrowserShortcutsEnabled     = false;

            pnlControl.Parent    = this;
            pnlControl.Dock      = DockStyle.Bottom;
            pnlControl.BackColor = Color.Transparent;

            chboxShow.Parent             = pnlControl;
            chboxShow.Text               = Language.T("Show a tip");
            chboxShow.Checked            = Configs.ShowStartingTip;
            chboxShow.TextAlign          = ContentAlignment.MiddleLeft;
            chboxShow.AutoSize           = true;
            chboxShow.ForeColor          = LayoutColors.ColorControlText;
            chboxShow.CheckStateChanged += new EventHandler(ChboxShow_CheckStateChanged);

            btnNextTip.Parent = pnlControl;
            btnNextTip.Text   = Language.T("Next Tip");
            btnNextTip.Name   = "Next";
            btnNextTip.Click += new EventHandler(Navigate);
            btnNextTip.UseVisualStyleBackColor = true;

            btnPrevTip.Parent = pnlControl;
            btnPrevTip.Text   = Language.T("Previous Tip");
            btnPrevTip.Name   = "Previous";
            btnPrevTip.Click += new EventHandler(Navigate);
            btnPrevTip.UseVisualStyleBackColor = true;

            btnClose.Parent = pnlControl;
            btnClose.Text   = Language.T("Close");
            btnClose.Name   = "Close";
            btnClose.Click += new EventHandler(Navigate);
            btnClose.UseVisualStyleBackColor = true;

            LoadStartingTips();

            return;
        }
        /// <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);
        }
        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;
        }
Ejemplo n.º 25
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;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Data_Horizon(int iMaxBars, DateTime dtStart, DateTime dtEnd, bool bUseStartDate, bool bUseEndDate)
        {
            this.maxBars      = iMaxBars;
            this.dtStart       = dtStart;
            this.dtEnd         = dtEnd;
            this.useEndDate   = bUseEndDate;
            this.useStartDate = bUseStartDate;

            btnAccept         = new Button();
            btnHelp           = new Button();
            btnCancel         = new Button();
            pnlBase           = new Fancy_Panel();
            dtpStartDate      = new DateTimePicker();
            dtpEndDate        = new DateTimePicker();
            chboxUseEndDate   = new CheckBox();
            chboxUseStartDate = new CheckBox();
            numUpDownMaxBars  = new NumericUpDown();
            lblMaxBars        = new Label();
            lblMinBars        = new Label();

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

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

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

            //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 pnlBase
            pnlBase.Parent = this;

            // chboxUseEndDate
            chboxUseEndDate.Parent    = pnlBase;
            chboxUseEndDate.ForeColor = LayoutColors.ColorControlText;
            chboxUseEndDate.BackColor = Color.Transparent;
            chboxUseEndDate.AutoSize  = true;
            chboxUseEndDate.Text      = Language.T("Remove data newer than:");
            chboxUseEndDate.CheckStateChanged += new EventHandler(chboxUseEndDate_CheckStateChanged);
            toolTip.SetToolTip(chboxUseEndDate, Language.T("All data newer than the specified date will be cut out."));

            // chboxUseStartDate
            chboxUseStartDate.Parent    = pnlBase;
            chboxUseStartDate.AutoSize  = true;
            chboxUseStartDate.ForeColor = LayoutColors.ColorControlText;
            chboxUseStartDate.BackColor = Color.Transparent;
            chboxUseStartDate.Text      = Language.T("Remove data older than:");
            chboxUseStartDate.CheckStateChanged += new EventHandler(chboxUseStartDate_CheckStateChanged);
            toolTip.SetToolTip(chboxUseStartDate, Language.T("All data older than the specified date will be cut out."));

            // Start Date
            dtpStartDate.Parent        = pnlBase;
            dtpStartDate.ForeColor     = LayoutColors.ColorControlText;
            dtpStartDate.ShowUpDown    = true;
            dtpStartDate.ValueChanged += new EventHandler(dtpStartDate_ValueChanged);

            // End Date
            dtpEndDate.Parent        = pnlBase;
            dtpEndDate.ForeColor     = LayoutColors.ColorControlText;
            dtpEndDate.ShowUpDown    = true;
            dtpEndDate.ValueChanged += new EventHandler(dtpEndDate_ValueChanged);

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

            // numUpDownMaxBars
            numUpDownMaxBars.BeginInit();
            numUpDownMaxBars.Parent    = pnlBase;
            numUpDownMaxBars.Name      = "MaxBars";
            numUpDownMaxBars.Minimum   = Configs.MIN_BARS;
            numUpDownMaxBars.Maximum   = Configs.MAX_BARS;
            numUpDownMaxBars.ThousandsSeparator = true;
            numUpDownMaxBars.ValueChanged += new EventHandler(numUpDown_ValueChanged);
            numUpDownMaxBars.TextAlign     = HorizontalAlignment.Center;
            numUpDownMaxBars.EndInit();

            //lblMinBars
            lblMinBars.Parent    = pnlBase;
            lblMinBars.AutoSize  = true;
            lblMinBars.ForeColor = LayoutColors.ColorControlText;
            lblMinBars.BackColor = Color.Transparent;
            lblMinBars.Text      = Language.T("Minimum number of bars:") + " " + Configs.MIN_BARS.ToString();
            lblMinBars.TextAlign = ContentAlignment.MiddleLeft;
        }
// ---------------------------------------------------------------------------

        /// <summary>
        /// Constructor
        /// </summary>
        public Indicator_Dialog(int slotNumb, SlotTypes slotType, bool isDefined)
        {
            this.slot      = slotNumb;
            this.slotType  = slotType;
            this.isDefined = isDefined;

            if (slotType == SlotTypes.Open)
            {
                slotCation      = Language.T("Opening Point of the Position");
                pnlParameters   = new Fancy_Panel(slotCation, LayoutColors.ColorSlotCaptionBackOpen);
                pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpen);
            }
            else if (slotType == SlotTypes.OpenFilter)
            {
                slotCation      = Language.T("Opening Logic Condition");
                pnlParameters   = new Fancy_Panel(slotCation, LayoutColors.ColorSlotCaptionBackOpenFilter);
                pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpenFilter);
            }
            else if (slotType == SlotTypes.Close)
            {
                slotCation      = Language.T("Closing Point of the Position");
                pnlParameters   = new Fancy_Panel(slotCation, LayoutColors.ColorSlotCaptionBackClose);
                pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackClose);
            }
            else
            {
                slotCation      = Language.T("Closing Logic Condition");
                pnlParameters   = new Fancy_Panel(slotCation, LayoutColors.ColorSlotCaptionBackCloseFilter);
                pnlTreeViewBase = new Fancy_Panel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackCloseFilter);
            }

            trvIndicators        = new TreeView();
            pnlSmallBalanceChart = new Small_Balance_Chart();
            btnAccept            = new Button();
            btnHelp    = new Button();
            btnDefault = new Button();
            btnCancel  = new Button();

            lblIndicatorInfo    = new Label();
            lblIndicatorWarning = new Label();
            lblIndicator        = new Label();
            lblGroup            = new Label();
            cbxGroup            = new ComboBox();
            aLblList            = new Label[5];
            aCbxList            = new ComboBox[5];
            aLblNumeric         = new Label[6];
            aNudNumeric         = new NUD[6];
            aChbCheck           = new CheckBox[2];

            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Icon            = Data.Icon;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            AcceptButton    = btnAccept;
            CancelButton    = btnCancel;
            Text            = Language.T("Logic and Parameters of the Indicators");

            // Panel TreeViewBase
            pnlTreeViewBase.Parent  = this;
            pnlTreeViewBase.Padding = new Padding(border, (int)pnlTreeViewBase.CaptionHeight, border, border);

            // TreeView trvIndicators
            trvIndicators.Parent                = pnlTreeViewBase;
            trvIndicators.Dock                  = DockStyle.Fill;
            trvIndicators.BackColor             = LayoutColors.ColorControlBack;
            trvIndicators.ForeColor             = LayoutColors.ColorControlText;
            trvIndicators.BorderStyle           = BorderStyle.None;
            trvIndicators.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(TrvIndicators_NodeMouseDoubleClick);
            trvIndicators.KeyPress             += new KeyPressEventHandler(TrvIndicators_KeyPress);

            pnlParameters.Parent = this;

            // pnlSmallBalanceChart
            pnlSmallBalanceChart.Parent = this;

            // lblIndicatorInfo
            lblIndicatorInfo.Parent          = pnlParameters;
            lblIndicatorInfo.Size            = new Size(16, 16);
            lblIndicatorInfo.BackColor       = Color.Transparent;
            lblIndicatorInfo.BackgroundImage = Properties.Resources.information;
            lblIndicatorInfo.Click          += new EventHandler(LblIndicatorInfo_Click);
            lblIndicatorInfo.MouseEnter     += new EventHandler(Label_MouseEnter);
            lblIndicatorInfo.MouseLeave     += new EventHandler(Label_MouseLeave);

            // lblIndicatorWarning
            lblIndicatorWarning.Parent          = pnlParameters;
            lblIndicatorWarning.Size            = new Size(16, 16);
            lblIndicatorWarning.BackColor       = Color.Transparent;
            lblIndicatorWarning.BackgroundImage = Properties.Resources.warning;
            lblIndicatorWarning.Visible         = false;
            lblIndicatorWarning.Click          += new EventHandler(LblIndicatorWarning_Click);
            lblIndicatorWarning.MouseEnter     += new EventHandler(Label_MouseEnter);
            lblIndicatorWarning.MouseLeave     += new EventHandler(Label_MouseLeave);

            // Label Indicator
            lblIndicator.Parent    = pnlParameters;
            lblIndicator.TextAlign = ContentAlignment.MiddleCenter;
            lblIndicator.Font      = new Font(Font.FontFamily, 14, FontStyle.Bold);
            lblIndicator.ForeColor = LayoutColors.ColorSlotIndicatorText;
            lblIndicator.BackColor = Color.Transparent;

            // Label aLblList[0]
            aLblList[0]           = new Label();
            aLblList[0].Parent    = pnlParameters;
            aLblList[0].TextAlign = ContentAlignment.BottomCenter;
            aLblList[0].ForeColor = LayoutColors.ColorControlText;
            aLblList[0].BackColor = Color.Transparent;

            // ComboBox aCbxList[0]
            aCbxList[0]                       = new ComboBox();
            aCbxList[0].Parent                = pnlParameters;
            aCbxList[0].DropDownStyle         = ComboBoxStyle.DropDownList;
            aCbxList[0].SelectedIndexChanged += new EventHandler(Param_Changed);

            // Logical Group
            lblGroup           = new Label();
            lblGroup.Parent    = pnlParameters;
            lblGroup.TextAlign = ContentAlignment.BottomCenter;
            lblGroup.ForeColor = LayoutColors.ColorControlText;
            lblGroup.BackColor = Color.Transparent;
            lblGroup.Text      = Language.T("Group");

            cbxGroup        = new ComboBox();
            cbxGroup.Parent = pnlParameters;
            if (slotType == SlotTypes.OpenFilter)
            {
                cbxGroup.Items.AddRange(new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "All" });
            }
            if (slotType == SlotTypes.CloseFilter)
            {
                cbxGroup.Items.AddRange(new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "all" });
            }
            cbxGroup.SelectedIndexChanged += new EventHandler(Group_Changed);
            cbxGroup.DropDownStyle         = ComboBoxStyle.DropDownList;
            toolTip.SetToolTip(cbxGroup, Language.T("The logical group of the slot."));

            // ListParams
            for (int i = 1; i < 5; i++)
            {
                aLblList[i]           = new Label();
                aLblList[i].Parent    = pnlParameters;
                aLblList[i].TextAlign = ContentAlignment.BottomCenter;
                aLblList[i].ForeColor = LayoutColors.ColorControlText;
                aLblList[i].BackColor = Color.Transparent;

                aCbxList[i]         = new ComboBox();
                aCbxList[i].Parent  = pnlParameters;
                aCbxList[i].Enabled = false;
                aCbxList[i].SelectedIndexChanged += new EventHandler(Param_Changed);
                aCbxList[i].DropDownStyle         = ComboBoxStyle.DropDownList;
            }

            // NumParams
            for (int i = 0; i < 6; i++)
            {
                aLblNumeric[i]           = new Label();
                aLblNumeric[i].Parent    = pnlParameters;
                aLblNumeric[i].TextAlign = ContentAlignment.MiddleRight;
                aLblNumeric[i].ForeColor = LayoutColors.ColorControlText;
                aLblNumeric[i].BackColor = Color.Transparent;

                aNudNumeric[i]               = new NUD();
                aNudNumeric[i].Parent        = pnlParameters;
                aNudNumeric[i].TextAlign     = HorizontalAlignment.Center;
                aNudNumeric[i].Enabled       = false;
                aNudNumeric[i].ValueChanged += new EventHandler(Param_Changed);
            }

            // CheckParams
            for (int i = 0; i < 2; i++)
            {
                aChbCheck[i]                 = new CheckBox();
                aChbCheck[i].Parent          = pnlParameters;
                aChbCheck[i].CheckAlign      = ContentAlignment.MiddleLeft;
                aChbCheck[i].TextAlign       = ContentAlignment.MiddleLeft;
                aChbCheck[i].CheckedChanged += new EventHandler(Param_Changed);
                aChbCheck[i].ForeColor       = LayoutColors.ColorControlText;
                aChbCheck[i].BackColor       = Color.Transparent;
                aChbCheck[i].Enabled         = false;
            }

            //Button Accept
            btnAccept.Parent                  = this;
            btnAccept.Text                    = Language.T("Accept");
            btnAccept.DialogResult            = DialogResult.OK;
            btnAccept.Click                  += new EventHandler(BtnOk_Click);
            btnAccept.UseVisualStyleBackColor = true;

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

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

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

            SetTreeViewIndicators();

            // ComboBoxindicator index selection.
            if (isDefined)
            {
                TreeNode [] atrn = trvIndicators.Nodes.Find(Data.Strategy.Slot[slot].IndParam.IndicatorName, true);
                trvIndicators.SelectedNode = atrn[0];
                UpdateFromIndicatorParam(Data.Strategy.Slot[slot].IndParam);
                SetLogicalGroup();
                CalculateIndicator(false);
                pnlSmallBalanceChart.SetChartData();
                pnlSmallBalanceChart.InitChart();
                pnlSmallBalanceChart.Invalidate();
            }
            else
            {
                string defaultIndicator;
                if (slotType == SlotTypes.Open)
                {
                    defaultIndicator = "Bar Opening";
                }
                else if (slotType == SlotTypes.OpenFilter)
                {
                    defaultIndicator = "Accelerator Oscillator";
                }
                else if (slotType == SlotTypes.Close)
                {
                    defaultIndicator = "Bar Closing";
                }
                else
                {
                    defaultIndicator = "Accelerator Oscillator";
                }

                TreeNode[] atrn = trvIndicators.Nodes.Find(defaultIndicator, true);
                trvIndicators.SelectedNode = atrn[0];
                TrvIndicatorsLoadIndicator(atrn[0]);
            }

            oppSignalBehaviour = Data.Strategy.OppSignalAction;

            if (slotType == SlotTypes.Close && Data.Strategy.CloseFilters > 0)
            {
                for (int iSlot = Data.Strategy.CloseSlot + 1; iSlot < Data.Strategy.Slots; iSlot++)
                {
                    closingConditions.Add(Data.Strategy.Slot[iSlot].Clone());
                }
            }

            return;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Optimizer()
        {
            pnlParamsBase     = new Panel();
            pnlParamsBase2    = new Panel();
            pnlCaptions       = new Panel();
            pnlParams         = new Panel();
            pnlLimitations    = new Fancy_Panel(Language.T("Limitations"));
            scrollBar         = new VScrollBar();
            smallBalanceChart = new Small_Balance_Chart();
            progressBar       = new ProgressBar();
            btnOptimize       = new Button();
            btnAccept         = new Button();
            btnCancel         = new Button();

            btnShowLimitations = new Button();
            btnShowSettings    = new Button();

            font          = this.Font;
            fontIndicator = new Font(Font.FontFamily, 11);
            colorText     = LayoutColors.ColorControlText;

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = btnAccept;
            CancelButton    = btnCancel;
            Text            = Language.T("Optimizer");
            FormClosing    += new FormClosingEventHandler(Optimizer_FormClosing);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            isOptimizing = false;
            SetPanelLimitations();

            return;
        }
        /// <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();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public Pivot_Points_Calculator()
        {
            pnlInput  = new Fancy_Panel(Language.T("Input Values"));
            pnlOutput = new Fancy_Panel(Language.T("Output Values"));

            alblInputNames   = new Label[3];
            atbxInputValues  = new TextBox[3];
            alblOutputNames  = new Label[7];
            alblOutputValues = new Label[7];

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

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

            // Input
            pnlInput.Parent = this;

            // Output
            pnlOutput.Parent = this;

            // Input Names
            string[] asInputNames = new string[] {
                Language.T("Highest price"),
                Language.T("Closing price"),
                Language.T("Lowest price"),
            };

            int iNumber = 0;
            foreach (string sName in asInputNames)
            {
                alblInputNames[iNumber] = new Label();
                alblInputNames[iNumber].Parent    = pnlInput;
                alblInputNames[iNumber].ForeColor = colorText;
                alblInputNames[iNumber].BackColor = Color.Transparent;
                alblInputNames[iNumber].AutoSize  = true;
                alblInputNames[iNumber].Text      = sName;

                atbxInputValues[iNumber] = new TextBox();
                atbxInputValues[iNumber].Parent = pnlInput;
                atbxInputValues[iNumber].TextChanged += new EventHandler(TbxInput_TextChanged);
                iNumber++;
            }

            // Output Names
            string[] asOutputNames = new string[] {
                Language.T("Resistance") + " 3",
                Language.T("Resistance") + " 2",
                Language.T("Resistance") + " 1",
                Language.T("Pivot Point"),
                Language.T("Support")    + " 1",
                Language.T("Support")    + " 2",
                Language.T("Support")    + " 3",
            };

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

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

                iNumber++;
            }

            alblOutputNames[3].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[3].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
        }
        /// <summary>
        /// Make a form
        /// </summary>
        public Strategy_Description()
        {
            pnlBase     = new Panel();
            pnlWarnBase = new Fancy_Panel();
            lblWarning  = new Label();
            pnlTbxBase  = new Fancy_Panel(Language.T("Strategy Description"));
            txboxInfo   = new TextBox();
            btnClose    = new Button();
            btnAccept   = new Button();
            btnClear    = new Button();

            // BBCode_viewer
            AcceptButton = btnClose;
            BackColor    = LayoutColors.ColorFormBack;
            Icon         = Data.Icon;
            MinimumSize  = new System.Drawing.Size(400, 400);
            Text         = Language.T("Strategy Description");
            FormClosing += new FormClosingEventHandler(Actions_FormClosing);

            Controls.Add(pnlBase);
            Controls.Add(btnAccept);
            Controls.Add(btnClose);
            Controls.Add(btnClear);

            // pnlWarnBase
            pnlWarnBase.Parent  = this;
            pnlWarnBase.Padding = new Padding(2, 4, 2, 2);

            // lblWarning
            lblWarning.Parent    = pnlWarnBase;
            lblWarning.TextAlign = ContentAlignment.MiddleCenter;
            lblWarning.BackColor = Color.Transparent;;
            lblWarning.ForeColor = LayoutColors.ColorControlText;
            lblWarning.AutoSize  = false;
            lblWarning.Dock      = DockStyle.Fill;
            if (Data.Strategy.Description != "")
            {
                if (!Data.IsStrDescriptionRelevant())
                {
                    lblWarning.Font = new Font(Font, FontStyle.Bold);
                    lblWarning.Text = Language.T("This description might be outdated!");
                }
                else
                {
                    lblWarning.Text = System.IO.Path.GetFileNameWithoutExtension(Data.StrategyName);
                }
            }
            else
            {
                lblWarning.Text = Language.T("You can write a description to the strategy!");
            }

            pnlTbxBase.Parent  = pnlBase;
            pnlTbxBase.Padding = new Padding(4, (int)pnlTbxBase.CaptionHeight + 1, 2, 3);
            pnlTbxBase.Dock    = DockStyle.Fill;


            // txboxInfo
            txboxInfo.Parent        = pnlTbxBase;
            txboxInfo.Dock          = DockStyle.Fill;
            txboxInfo.BackColor     = LayoutColors.ColorControlBack;
            txboxInfo.ForeColor     = LayoutColors.ColorControlText;
            txboxInfo.BorderStyle   = BorderStyle.None;
            txboxInfo.Multiline     = true;
            txboxInfo.AcceptsReturn = true;
            txboxInfo.AcceptsTab    = true;
            txboxInfo.ScrollBars    = ScrollBars.Vertical;
            txboxInfo.KeyDown      += new KeyEventHandler(TxboxInfo_KeyDown);
            txboxInfo.Text          = Data.Strategy.Description;
            txboxInfo.Select(0, 0);

            oldInfo = Data.Strategy.Description;

            // btnClose
            btnClose.Text   = Language.T("Close");
            btnClose.Click += new System.EventHandler(BtnClose_Click);
            btnClose.UseVisualStyleBackColor = true;

            // btnAccept
            btnAccept.Text   = Language.T("Accept");
            btnAccept.Click += new System.EventHandler(BtnAccept_Click);
            btnAccept.UseVisualStyleBackColor = true;

            // btnClear
            btnClear.Text   = Language.T("Clear");
            btnClear.Click += new System.EventHandler(BtnClear_Click);
            btnClear.UseVisualStyleBackColor = true;
        }
        /// <summary>
        /// Make a form
        /// </summary>
        public Strategy_Description()
        {
            pnlBase     = new Panel();
            pnlWarnBase = new Fancy_Panel();
            lblWarning  = new Label();
            pnlTbxBase  = new Fancy_Panel(Language.T("Strategy Description"));
            txboxInfo   = new TextBox();
            btnClose    = new Button();
            btnAccept   = new Button();
            btnClear    = new Button();

            // BBCode_viewer
            AcceptButton = btnClose;
            BackColor    = LayoutColors.ColorFormBack;
            Icon         = Data.Icon;
            MinimumSize  = new System.Drawing.Size(400, 400);
            Text         = Language.T("Strategy Description");
            FormClosing += new FormClosingEventHandler(Actions_FormClosing);

            Controls.Add(pnlBase);
            Controls.Add(btnAccept);
            Controls.Add(btnClose);
            Controls.Add(btnClear);

            // pnlWarnBase
            pnlWarnBase.Parent = this;
            pnlWarnBase.Padding = new Padding(2, 4, 2, 2);

            // lblWarning
            lblWarning.Parent = pnlWarnBase;
            lblWarning.TextAlign   = ContentAlignment.MiddleCenter;
            lblWarning.BackColor = Color.Transparent; ;
            lblWarning.ForeColor   = LayoutColors.ColorControlText;
            lblWarning.AutoSize = false;
            lblWarning.Dock = DockStyle.Fill;
            if (Data.Strategy.Description != "")
            {
                if (!Data.IsStrDescriptionRelevant())
                {
                    lblWarning.Font = new Font(Font, FontStyle.Bold);
                    lblWarning.Text = Language.T("This description might be outdated!");
                }
                else
                    lblWarning.Text = System.IO.Path.GetFileNameWithoutExtension(Data.StrategyName);
            }
            else
                lblWarning.Text = Language.T("You can write a description of the strategy!");

            pnlTbxBase.Parent = pnlBase;
            pnlTbxBase.Padding = new Padding(4, (int)pnlTbxBase.CaptionHeight + 1, 2, 3);
            pnlTbxBase.Dock = DockStyle.Fill;

            // txboxInfo
            txboxInfo.Parent        = pnlTbxBase;
            txboxInfo.Dock          = DockStyle.Fill;
            txboxInfo.BackColor     = LayoutColors.ColorControlBack;
            txboxInfo.ForeColor     = LayoutColors.ColorControlText;
            txboxInfo.BorderStyle   = BorderStyle.None;
            txboxInfo.Multiline     = true;
            txboxInfo.AcceptsReturn = true;
            txboxInfo.AcceptsTab    = true;
            txboxInfo.ScrollBars    = ScrollBars.Vertical;
            txboxInfo.KeyDown      += new KeyEventHandler(TxboxInfo_KeyDown);
            txboxInfo.Text          = Data.Strategy.Description;
            txboxInfo.Select(0, 0);

            oldInfo = Data.Strategy.Description;

            // btnClose
            btnClose.Text   = Language.T("Close");
            btnClose.Click += new System.EventHandler(BtnClose_Click);
            btnClose.UseVisualStyleBackColor = true;

            // btnAccept
            btnAccept.Text   = Language.T("Accept");
            btnAccept.Click += new System.EventHandler(BtnAccept_Click);
            btnAccept.UseVisualStyleBackColor = true;

            // btnClear
            btnClear.Text   = Language.T("Clear");
            btnClear.Click += new System.EventHandler(BtnClear_Click);
            btnClear.UseVisualStyleBackColor = true;
        }
Ejemplo n.º 33
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Fibonacci_Levels_Calculator()
        {
            pnlInput  = new Fancy_Panel(Language.T("Input Values"));
            pnlOutput = new Fancy_Panel(Language.T("Output Values"));

            alblInputNames   = new Label[2];
            atbxInputValues  = new TextBox[2];
            alblOutputNames  = new Label[10];
            alblOutputValues = new Label[10];

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

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

            // Input
            pnlInput.Parent = this;

            // Output
            pnlOutput.Parent = this;

            // Input Names
            string[] asInputNames = new string[] {
                Language.T("First price"),
                Language.T("Second price"),
            };

            int number = 0;

            foreach (string sName 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      = sName;

                atbxInputValues[number]              = new TextBox();
                atbxInputValues[number].Parent       = pnlInput;
                atbxInputValues[number].TextChanged += new EventHandler(TbxInput_TextChanged);
                number++;
            }

            // Output Names

            number = 0;
            foreach (float fn in afLevels)
            {
                alblOutputNames[number]           = new Label();
                alblOutputNames[number].Parent    = pnlOutput;
                alblOutputNames[number].ForeColor = colorText;
                alblOutputNames[number].BackColor = Color.Transparent;
                alblOutputNames[number].AutoSize  = true;
                alblOutputNames[number].Text      = fn.ToString("F1") + " %";

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

                number++;
            }

            alblOutputNames[2].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputNames[3].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputNames[4].Font  = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[2].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[3].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
            alblOutputValues[4].Font = new Font(Font.FontFamily, Font.Size, FontStyle.Bold);
        }
        /// <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;
        }