Beispiel #1
0
        /// <summary>
        ///     Updates the chart and info panel.
        /// </summary>
        private void ShowScanningResult()
        {
            BalanceChart.SetChartData();
            BalanceChart.InitChart();
            BalanceChart.Invalidate();
            InfoPanel.Invalidate();

            ChbAutoscan.Visible = true;
            ChbTickScan.Visible = Configs.UseTickData || isTickDataFile;
        }
Beispiel #2
0
        /// <summary>
        ///     Sets the controls in tabPageStatus
        /// </summary>
        private void InitializePageStatus()
        {
            // tabPageStatus
            TabPageStatus.Name       = "tabPageStatus";
            TabPageStatus.Text       = Language.T("Status");
            TabPageStatus.ImageIndex = 0;
            TabPageStatus.Resize    += TabPageStatusResize;

            // Panel Warning
            PnlWarning = new FancyPanel
            {
                Height  = 0,
                Enabled = false,
                Visible = false
            };

            // Panel Connection
            PnlConnection = new FancyPanel(Language.T("Connection Status"))
            {
                Parent = TabPageStatus
            };

            // lblConnection
            LblConnection = new Label
            {
                Name      = "lblConnection",
                Parent    = PnlConnection,
                Text      = Language.T("Not Connected. You have to connect to a MetaTrader terminal."),
                TextAlign = ContentAlignment.MiddleLeft
            };

            // Panel Data Info
            PnlDataInfoBase = new FancyPanel(Language.T("Data Info"))
            {
                Parent = TabPageStatus
            };
            PnlDataInfoBase.Padding = new Padding(2, (int)PnlDataInfoBase.CaptionHeight, 2, 2);

            TbxDataInfo = new TextBox
            {
                Parent        = PnlDataInfoBase,
                BorderStyle   = BorderStyle.None,
                Dock          = DockStyle.Fill,
                TabStop       = false,
                Multiline     = true,
                AcceptsReturn = true,
                AcceptsTab    = true,
                WordWrap      = false,
                ScrollBars    = ScrollBars.Vertical,
                Font          = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((204)))
            };

            PnlDataInfoButtons = new Panel {
                Parent = PnlDataInfoBase, Dock = DockStyle.Top
            };
            PnlDataInfoButtons.Paint += PnlDataInfoButtons_Paint;

            BtnShowMarketInfo = new Button {
                Parent = PnlDataInfoButtons, Text = Language.T("Market Info")
            };
            BtnShowMarketInfo.Click += BtnShowMarketInfoClick;
            BtnShowMarketInfo.UseVisualStyleBackColor = true;

            BtnShowAccountInfo = new Button {
                Parent = PnlDataInfoButtons, Text = Language.T("Account Info")
            };
            BtnShowAccountInfo.Click += BtnShowAccountInfoClick;
            BtnShowAccountInfo.UseVisualStyleBackColor = true;

            BtnShowBars = new Button {
                Parent = PnlDataInfoButtons, Text = Language.T("Loaded Bars")
            };
            BtnShowBars.Click += BtnShowBarsClick;
            BtnShowBars.UseVisualStyleBackColor = true;

            PnlMarketInfo = new InfoPanel(Language.T("Market Information"))
            {
                Parent = TabPageStatus
            };
            PnlUsefulLinks = new LinkPanel(Language.T("Useful Links"))
            {
                Parent = TabPageStatus
            };
            PnlForexBrokers = new LinkPanel(Language.T("Forex Brokers"))
            {
                Parent = TabPageStatus
            };

            SetStatusColors();
        }
        /// <summary>
        ///     Sets the controls in tabPageStatus
        /// </summary>
        private void InitializePageStatus()
        {
            // tabPageStatus
            TabPageStatus.Name = "tabPageStatus";
            TabPageStatus.Text = Language.T("Status");
            TabPageStatus.ImageIndex = 0;
            TabPageStatus.Resize += TabPageStatusResize;

            // Panel Warning
            PnlWarning = new FancyPanel
                {
                    Height = 0,
                    Enabled = false,
                    Visible = false
                };

            // Panel Connection
            PnlConnection = new FancyPanel(Language.T("Connection Status")) {Parent = TabPageStatus};

            // lblConnection
            LblConnection = new Label
                {
                    Name = "lblConnection",
                    Parent = PnlConnection,
                    Text = Language.T("Not Connected. You have to connect to a MetaTrader terminal."),
                    TextAlign = ContentAlignment.MiddleLeft
                };

            // Panel Data Info
            PnlDataInfoBase = new FancyPanel(Language.T("Data Info")) {Parent = TabPageStatus};
            PnlDataInfoBase.Padding = new Padding(2, (int) PnlDataInfoBase.CaptionHeight, 2, 2);

            TbxDataInfo = new TextBox
                {
                    Parent = PnlDataInfoBase,
                    BorderStyle = BorderStyle.None,
                    Dock = DockStyle.Fill,
                    TabStop = false,
                    Multiline = true,
                    AcceptsReturn = true,
                    AcceptsTab = true,
                    WordWrap = false,
                    ScrollBars = ScrollBars.Vertical,
                    Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((204)))
                };

            PnlDataInfoButtons = new Panel {Parent = PnlDataInfoBase, Dock = DockStyle.Top};
            PnlDataInfoButtons.Paint += PnlDataInfoButtons_Paint;

            BtnShowMarketInfo = new Button {Parent = PnlDataInfoButtons, Text = Language.T("Market Info")};
            BtnShowMarketInfo.Click += BtnShowMarketInfoClick;
            BtnShowMarketInfo.UseVisualStyleBackColor = true;

            BtnShowAccountInfo = new Button {Parent = PnlDataInfoButtons, Text = Language.T("Account Info")};
            BtnShowAccountInfo.Click += BtnShowAccountInfoClick;
            BtnShowAccountInfo.UseVisualStyleBackColor = true;

            BtnShowBars = new Button {Parent = PnlDataInfoButtons, Text = Language.T("Loaded Bars")};
            BtnShowBars.Click += BtnShowBarsClick;
            BtnShowBars.UseVisualStyleBackColor = true;

            PnlMarketInfo = new InfoPanel(Language.T("Market Information")) {Parent = TabPageStatus};
            PnlUsefulLinks = new LinkPanel(Language.T("Useful Links")) {Parent = TabPageStatus};
            PnlForexBrokers = new LinkPanel(Language.T("Forex Brokers")) {Parent = TabPageStatus};

            SetStatusColors();
        }
Beispiel #4
0
        /// <summary>
        ///     Initialize the controls in panel pnlMarket
        /// </summary>
        private void InitializeMarket()
        {
            var toolTip = new ToolTip();

            // Symbol
            ComboBoxSymbol = new ToolStripComboBox
            {
                Name          = "ComboBoxSymbol",
                AutoSize      = false,
                DropDownStyle = ComboBoxStyle.DropDownList,
                ToolTipText   = Language.T("Symbol"),
                Overflow      = ToolStripItemOverflow.Never
            };
            foreach (string symbol in Instruments.SymbolList)
            {
                ComboBoxSymbol.Items.Add(symbol);
            }
            ComboBoxSymbol.SelectedIndex         = 0;
            ComboBoxSymbol.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripMarket.Items.Add(ComboBoxSymbol);

            // Period
            var periods = new[]
            {
                "  1 " + Language.T("Minute"),
                "  5 " + Language.T("Minutes"),
                "15 " + Language.T("Minutes"),
                "30 " + Language.T("Minutes"),
                "  1 " + Language.T("Hour"),
                "  4 " + Language.T("Hours"),
                "  1 " + Language.T("Day"),
                "  1 " + Language.T("Week")
            };

            ComboBoxPeriod = new ToolStripComboBox
            {
                Name          = "ComboBoxPeriod",
                AutoSize      = false,
                DropDownStyle = ComboBoxStyle.DropDownList,
                ToolTipText   = Language.T("Data time frame."),
                Overflow      = ToolStripItemOverflow.Never
            };
            foreach (string period in periods)
            {
                ComboBoxPeriod.Items.Add(period);
            }
            ComboBoxPeriod.SelectedIndex         = 6;
            ComboBoxPeriod.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripMarket.Items.Add(ComboBoxPeriod);

            // Button Market Properties
            ButtonCharges = new ToolStripButton
            {
                Text        = Language.T("Charges"),
                Name        = "Charges",
                ToolTipText = Language.T("Spread, Swap numbers, Slippage."),
                Overflow    = ToolStripItemOverflow.Never
            };
            ButtonCharges.Click += BtnToolsOnClick;
            ToolStripMarket.Items.Add(ButtonCharges);

            ToolStripMarket.Resize += TsMarketResize;

            // Info Panel Market Statistics
            InfoPanelMarketStatistics = new InfoPanel {
                Parent = PanelMarket, Dock = DockStyle.Fill
            };

            // Splitter
            new Splitter {
                Parent = PanelMarket, Dock = DockStyle.Bottom, BorderStyle = BorderStyle.None, Height = Gap
            };

            // Panel Charts Base
            marketChartsBase = new Panel
            {
                Parent      = PanelMarket,
                Dock        = DockStyle.Bottom,
                MinimumSize = new Size(100, 50)
            };

            // Small Indicator Chart
            IndicatorChart = new SmallIndicatorChart
            {
                Parent                 = marketChartsBase,
                Cursor                 = Cursors.Hand,
                Dock                   = DockStyle.Fill,
                ShowDynamicInfo        = true,
                IsContextButtonVisible = true
            };
            IndicatorChart.PopUpContextMenu.Items.AddRange(GetIndicatorChartContextMenuItems());
            IndicatorChart.MouseUp    += IndicatorChartMouseUp;
            IndicatorChart.MouseMove  += IndicatorChartMouseMove;
            IndicatorChart.MouseLeave += IndicatorChartMouseLeave;
            toolTip.SetToolTip(IndicatorChart, Language.T("Click to view the full chart."));

            // Small Histogram Chart
            HistogramChart = new SmallHistogramChart
            {
                Parent                 = marketChartsBase,
                Dock                   = DockStyle.Fill,
                ShowDynamicInfo        = true,
                Visible                = false,
                IsContextButtonVisible = true
            };
            HistogramChart.PopUpContextMenu.Items.AddRange(GetHistogramChartContextMenuItems());
            HistogramChart.AddContextMenuItems();
            HistogramChart.MouseMove  += HistogramChartMouseMove;
            HistogramChart.MouseLeave += IndicatorChartMouseLeave;

            PanelMarket.Resize += PnlMarketResize;
        }
        /// <summary>
        ///     Initializes the controls in panel pnlOverview
        /// </summary>
        private void InitializeAccount()
        {
            var toolTip = new ToolTip();

            string[] methods = Enum.GetNames(typeof (InterpolationMethod));
            for (int i = 0; i < methods.Length; i++)
                methods[i] = Language.T(methods[i]);

            Graphics g = CreateGraphics();
            int maxWidth = 0;
            foreach (string method in methods)
                if ((int) g.MeasureString(method, Font).Width > maxWidth)
                    maxWidth = (int) g.MeasureString(method, Font).Width;
            g.Dispose();

            // ComboBox Interpolation Methods
            ComboBoxInterpolationMethod = new ToolStripComboBox
                {
                    Name = "ComboBoxInterpolationMethod",
                    AutoSize = false,
                    DropDownStyle = ComboBoxStyle.DropDownList,
                    Width = maxWidth + (int) (18*Data.HorizontalDlu),
                    ToolTipText = Language.T("Bar interpolation method.")
                };
            foreach (string method in methods)
                ComboBoxInterpolationMethod.Items.Add(method);
            ComboBoxInterpolationMethod.SelectedIndex = 0;
            ComboBoxInterpolationMethod.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripAccount.Items.Add(ComboBoxInterpolationMethod);

            // Button Comparator
            var tsbtComparator = new ToolStripButton {Text = Language.T("Comparator"), Name = "Comparator"};
            tsbtComparator.Click += BtnToolsOnClick;
            tsbtComparator.ToolTipText = Language.T("Compare the interpolating methods.");
            ToolStripAccount.Items.Add(tsbtComparator);

            // Button Scanner
            var tsbtScanner = new ToolStripButton {Text = Language.T("Scanner"), Name = "Scanner"};
            tsbtScanner.Click += BtnToolsOnClick;
            tsbtScanner.ToolTipText = Language.T("Perform a deep intrabar scan.") + Environment.NewLine +
                                      Language.T("Quick scan") + " - F6.";
            ToolStripAccount.Items.Add(tsbtScanner);

            // Button Analyzer
            var tsbtAnalyzer = new ToolStripButton {Text = Language.T("Analyzer"), Name = "Analyzer"};
            tsbtAnalyzer.Click += BtnToolsOnClick;
            ToolStripAccount.Items.Add(tsbtAnalyzer);

            // Info Panel Account Statistics
            InfoPanelAccountStatistics = new InfoPanel {Parent = PanelAccount, Dock = DockStyle.Fill};

            new Splitter {Parent = PanelAccount, Dock = DockStyle.Bottom, BorderStyle = BorderStyle.None, Height = Gap};

            // Small Balance Chart
            BalanceChart = new SmallBalanceChart
                {
                    Parent = PanelAccount,
                    Cursor = Cursors.Hand,
                    Dock = DockStyle.Bottom,
                    MinimumSize = new Size(100, 50),
                    ShowDynamicInfo = true,
                    IsContextButtonVisible = true
                };
            BalanceChart.PopUpContextMenu.Items.AddRange(GetBalanceChartContextMenuItems());
            BalanceChart.MouseMove += SmallBalanceChartMouseMove;
            BalanceChart.MouseLeave += SmallBalanceChartMouseLeave;
            BalanceChart.MouseUp += SmallBalanceChart_MouseUp;
            toolTip.SetToolTip(BalanceChart, Language.T("Click to view the full chart.") +
                                             Environment.NewLine +
                                             Language.T("Right click to detach chart."));

            PanelAccount.Resize += PnlAccountResize;
        }
        /// <summary>
        ///     Initialize the controls in panel pnlMarket
        /// </summary>
        private void InitializeMarket()
        {
            var toolTip = new ToolTip();

            // Symbol
            ComboBoxSymbol = new ToolStripComboBox
                {
                    Name = "ComboBoxSymbol",
                    AutoSize = false,
                    DropDownStyle = ComboBoxStyle.DropDownList,
                    ToolTipText = Language.T("Symbol"),
                    Overflow = ToolStripItemOverflow.Never
                };
            foreach (string symbol in Instruments.SymbolList)
                ComboBoxSymbol.Items.Add(symbol);
            ComboBoxSymbol.SelectedIndex = 0;
            ComboBoxSymbol.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripMarket.Items.Add(ComboBoxSymbol);

            // Period
            var periods = new[]
                {
                    "  1 " + Language.T("Minute"),
                    "  5 " + Language.T("Minutes"),
                    "15 " + Language.T("Minutes"),
                    "30 " + Language.T("Minutes"),
                    "  1 " + Language.T("Hour"),
                    "  4 " + Language.T("Hours"),
                    "  1 " + Language.T("Day"),
                    "  1 " + Language.T("Week")
                };
            ComboBoxPeriod = new ToolStripComboBox
                {
                    Name = "ComboBoxPeriod",
                    AutoSize = false,
                    DropDownStyle = ComboBoxStyle.DropDownList,
                    ToolTipText = Language.T("Data time frame."),
                    Overflow = ToolStripItemOverflow.Never
                };
            foreach (string period in periods)
                ComboBoxPeriod.Items.Add(period);
            ComboBoxPeriod.SelectedIndex = 6;
            ComboBoxPeriod.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripMarket.Items.Add(ComboBoxPeriod);

            // Button Market Properties
            ButtonCharges = new ToolStripButton
                {
                    Text = Language.T("Charges"),
                    Name = "Charges",
                    ToolTipText = Language.T("Spread, Swap numbers, Slippage."),
                    Overflow = ToolStripItemOverflow.Never
                };
            ButtonCharges.Click += BtnToolsOnClick;
            ToolStripMarket.Items.Add(ButtonCharges);

            ToolStripMarket.Resize += TsMarketResize;

            // Info Panel Market Statistics
            InfoPanelMarketStatistics = new InfoPanel {Parent = PanelMarket, Dock = DockStyle.Fill};

            // Splitter
            new Splitter {Parent = PanelMarket, Dock = DockStyle.Bottom, BorderStyle = BorderStyle.None, Height = Gap};

            // Panel Charts Base
            marketChartsBase = new Panel
                {
                    Parent = PanelMarket,
                    Dock = DockStyle.Bottom,
                    MinimumSize = new Size(100, 50)
                };

            // Small Indicator Chart
            IndicatorChart = new SmallIndicatorChart
                {
                    Parent = marketChartsBase,
                    Cursor = Cursors.Hand,
                    Dock = DockStyle.Fill,
                    ShowDynamicInfo = true,
                    IsContextButtonVisible = true
                };
            IndicatorChart.PopUpContextMenu.Items.AddRange(GetIndicatorChartContextMenuItems());
            IndicatorChart.MouseUp += IndicatorChartMouseUp;
            IndicatorChart.MouseMove += IndicatorChartMouseMove;
            IndicatorChart.MouseLeave += IndicatorChartMouseLeave;
            toolTip.SetToolTip(IndicatorChart, Language.T("Click to view the full chart."));

            // Small Histogram Chart
            HistogramChart = new SmallHistogramChart
                {
                    Parent = marketChartsBase,
                    Dock = DockStyle.Fill,
                    ShowDynamicInfo = true,
                    Visible = false,
                    IsContextButtonVisible = true
                };
            HistogramChart.PopUpContextMenu.Items.AddRange(GetHistogramChartContextMenuItems());
            HistogramChart.AddContextMenuItems();
            HistogramChart.MouseMove += HistogramChartMouseMove;
            HistogramChart.MouseLeave += IndicatorChartMouseLeave;

            PanelMarket.Resize += PnlMarketResize;
        }
        /// <summary>
        ///     Initializes the controls in panel pnlOverview
        /// </summary>
        private void InitializeAccount()
        {
            var toolTip = new ToolTip();

            string[] methods = Enum.GetNames(typeof(InterpolationMethod));
            for (int i = 0; i < methods.Length; i++)
            {
                methods[i] = Language.T(methods[i]);
            }

            Graphics g        = CreateGraphics();
            int      maxWidth = 0;

            foreach (string method in methods)
            {
                if ((int)g.MeasureString(method, Font).Width > maxWidth)
                {
                    maxWidth = (int)g.MeasureString(method, Font).Width;
                }
            }
            g.Dispose();

            // ComboBox Interpolation Methods
            ComboBoxInterpolationMethod = new ToolStripComboBox
            {
                Name          = "ComboBoxInterpolationMethod",
                AutoSize      = false,
                DropDownStyle = ComboBoxStyle.DropDownList,
                Width         = maxWidth + (int)(18 * Data.HorizontalDlu),
                ToolTipText   = Language.T("Bar interpolation method.")
            };
            foreach (string method in methods)
            {
                ComboBoxInterpolationMethod.Items.Add(method);
            }
            ComboBoxInterpolationMethod.SelectedIndex         = 0;
            ComboBoxInterpolationMethod.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripAccount.Items.Add(ComboBoxInterpolationMethod);

            // Button Comparator
            var tsbtComparator = new ToolStripButton {
                Text = Language.T("Comparator"), Name = "Comparator"
            };

            tsbtComparator.Click      += BtnToolsOnClick;
            tsbtComparator.ToolTipText = Language.T("Compare the interpolating methods.");
            ToolStripAccount.Items.Add(tsbtComparator);

            // Button Scanner
            var tsbtScanner = new ToolStripButton {
                Text = Language.T("Scanner"), Name = "Scanner"
            };

            tsbtScanner.Click      += BtnToolsOnClick;
            tsbtScanner.ToolTipText = Language.T("Perform a deep intrabar scan.") + Environment.NewLine +
                                      Language.T("Quick scan") + " - F6.";
            ToolStripAccount.Items.Add(tsbtScanner);

            // Button Analyzer
            var tsbtAnalyzer = new ToolStripButton {
                Text = Language.T("Analyzer"), Name = "Analyzer"
            };

            tsbtAnalyzer.Click += BtnToolsOnClick;
            ToolStripAccount.Items.Add(tsbtAnalyzer);

            // Info Panel Account Statistics
            InfoPanelAccountStatistics = new InfoPanel {
                Parent = PanelAccount, Dock = DockStyle.Fill
            };

            new Splitter {
                Parent = PanelAccount, Dock = DockStyle.Bottom, BorderStyle = BorderStyle.None, Height = Gap
            };

            // Small Balance Chart
            BalanceChart = new SmallBalanceChart
            {
                Parent                 = PanelAccount,
                Cursor                 = Cursors.Hand,
                Dock                   = DockStyle.Bottom,
                MinimumSize            = new Size(100, 50),
                ShowDynamicInfo        = true,
                IsContextButtonVisible = true
            };
            BalanceChart.PopUpContextMenu.Items.AddRange(GetBalanceChartContextMenuItems());
            BalanceChart.MouseMove  += SmallBalanceChartMouseMove;
            BalanceChart.MouseLeave += SmallBalanceChartMouseLeave;
            BalanceChart.MouseUp    += SmallBalanceChart_MouseUp;
            toolTip.SetToolTip(BalanceChart, Language.T("Click to view the full chart.") +
                               Environment.NewLine +
                               Language.T("Right click to detach chart."));

            PanelAccount.Resize += PnlAccountResize;
        }