コード例 #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;
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
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;
        }
コード例 #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;
        }
コード例 #5
0
        /// <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;
        }