Draws a small indicator chart
Inheritance: System.Windows.Forms.Panel
Example #1
0
        /// <summary>
        /// Shows the market dynamic info on the Status Bar
        /// </summary>
        void SmallIndicatorChart_MouseMove(object sender, MouseEventArgs e)
        {
            Small_Indicator_Chart chart = (Small_Indicator_Chart)sender;

            ToolStripStatusLabelChartInfo = chart.CurrentBarInfo;
        }
Example #2
0
        protected Small_Indicator_Chart smallIndicatorChart; //Indicator chart

        /// <summary>
        /// Initialize the controls in panel pnlMarket
        /// </summary>
        void InitializeMarket()
        {
            // Symbol
            tscbSymbol          = new ToolStripComboBox();
            tscbSymbol.Name     = "tscbSymbol";
            tscbSymbol.AutoSize = false;
            tscbSymbol.Items.AddRange(Instruments.SymbolList);
            tscbSymbol.DropDownStyle         = ComboBoxStyle.DropDownList;
            tscbSymbol.SelectedIndex         = 0;
            tscbSymbol.ToolTipText           = Language.T("Symbol");
            tscbSymbol.Overflow              = ToolStripItemOverflow.Never;
            tscbSymbol.SelectedIndexChanged += new EventHandler(SelectedIndexChanged);
            tsMarket.Items.Add(tscbSymbol);

            // Period
            tscbPeriod               = new ToolStripComboBox();
            tscbPeriod.Name          = "tscbPeriod";
            tscbPeriod.AutoSize      = false;
            tscbPeriod.DropDownStyle = ComboBoxStyle.DropDownList;
            tscbPeriod.Items.AddRange(new string []
            {
                "  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")
            });
            tscbPeriod.SelectedIndex         = 6;
            tscbPeriod.ToolTipText           = Language.T("Data time frame.");
            tscbPeriod.Overflow              = ToolStripItemOverflow.Never;
            tscbPeriod.SelectedIndexChanged += new EventHandler(SelectedIndexChanged);
            tsMarket.Items.Add(tscbPeriod);

            // Button Market Properties
            tsbtnCharges             = new ToolStripButton();
            tsbtnCharges.Text        = Language.T("Charges");
            tsbtnCharges.Name        = "Charges";
            tsbtnCharges.ToolTipText = Language.T("Spread, Swap numbers, Slippage.");
            tsbtnCharges.Overflow    = ToolStripItemOverflow.Never;
            tsbtnCharges.Click      += new EventHandler(BtnTools_OnClick);
            tsMarket.Items.Add(tsbtnCharges);

            tsMarket.Resize += new EventHandler(tsMarket_Resize);

            // Info Panel Market Statistics
            infpnlMarketStatistics        = new Info_Panel();
            infpnlMarketStatistics.Parent = pnlMarket;
            infpnlMarketStatistics.Dock   = DockStyle.Fill;

            // Splitter
            Splitter splitter = new Splitter();

            splitter.Parent      = pnlMarket;
            splitter.Dock        = DockStyle.Bottom;
            splitter.BorderStyle = BorderStyle.None;
            splitter.Height      = space;

            // Small Indicator Chart
            smallIndicatorChart                 = new Small_Indicator_Chart();
            smallIndicatorChart.Parent          = pnlMarket;
            smallIndicatorChart.Cursor          = Cursors.Hand;
            smallIndicatorChart.Dock            = DockStyle.Bottom;
            smallIndicatorChart.MinimumSize     = new Size(100, 50);
            smallIndicatorChart.ShowDynamicInfo = true;
            smallIndicatorChart.MouseUp        += new MouseEventHandler(SmallIndicatorChart_MouseUp);
            smallIndicatorChart.MouseMove      += new MouseEventHandler(SmallIndicatorChart_MouseMove);
            smallIndicatorChart.MouseLeave     += new EventHandler(SmallIndicatorChart_MouseLeave);
            toolTip.SetToolTip(smallIndicatorChart, Language.T("Click to view the full chart."));

            pnlMarket.Resize += new EventHandler(pnlMarket_Resize);

            return;
        }
        /// <summary>
        /// Initialize the controls in panel pnlMarket
        /// </summary>
        void InitializeMarket()
        {
            // Symbol
            tscbSymbol = new ToolStripComboBox();
            tscbSymbol.Name          = "tscbSymbol";
            tscbSymbol.AutoSize      = false;
            tscbSymbol.Items.AddRange(Instruments.SymbolList);
            tscbSymbol.DropDownStyle = ComboBoxStyle.DropDownList;
            tscbSymbol.SelectedIndex = 0;
            tscbSymbol.ToolTipText   = Language.T("Symbol");
            tscbSymbol.Overflow      = ToolStripItemOverflow.Never;
            tscbSymbol.SelectedIndexChanged += new EventHandler(SelectedIndexChanged);
            tsMarket.Items.Add(tscbSymbol);

            // Period
            tscbPeriod = new ToolStripComboBox();
            tscbPeriod.Name          = "tscbPeriod";
            tscbPeriod.AutoSize      = false;
            tscbPeriod.DropDownStyle = ComboBoxStyle.DropDownList;
            tscbPeriod.Items.AddRange(new string []
                {
                    "  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")
                });
            tscbPeriod.SelectedIndex = 6;
            tscbPeriod.ToolTipText   =  Language.T("Data time frame.");
            tscbPeriod.Overflow      = ToolStripItemOverflow.Never;
            tscbPeriod.SelectedIndexChanged += new EventHandler(SelectedIndexChanged);
            tsMarket.Items.Add(tscbPeriod);

            // Button Market Properties
            tsbtnCharges = new ToolStripButton();
            tsbtnCharges.Text        = Language.T("Charges");
            tsbtnCharges.Name        = "Charges";
            tsbtnCharges.ToolTipText = Language.T("Spread, Swap numbers, Slippage.");
            tsbtnCharges.Overflow    = ToolStripItemOverflow.Never;
            tsbtnCharges.Click      += new EventHandler(BtnTools_OnClick);
            tsMarket.Items.Add(tsbtnCharges);

            tsMarket.Resize += new EventHandler(tsMarket_Resize);

            // Info Panel Market Statistics
            infpnlMarketStatistics = new Info_Panel();
            infpnlMarketStatistics.Parent = pnlMarket;
            infpnlMarketStatistics.Dock   = DockStyle.Fill;

            // Splitter
            Splitter splitter    = new Splitter();
            splitter.Parent      = pnlMarket;
            splitter.Dock        = DockStyle.Bottom;
            splitter.BorderStyle = BorderStyle.None;
            splitter.Height      = space;

            // Small Indicator Chart
            smallIndicatorChart = new Small_Indicator_Chart();
            smallIndicatorChart.Parent          = pnlMarket;
            smallIndicatorChart.Cursor          = Cursors.Hand;
            smallIndicatorChart.Dock            = DockStyle.Bottom;
            smallIndicatorChart.MinimumSize     = new Size(100, 50);
            smallIndicatorChart.ShowDynamicInfo = true;
            smallIndicatorChart.MouseUp        += new MouseEventHandler(SmallIndicatorChart_MouseUp);
            smallIndicatorChart.MouseMove      += new MouseEventHandler(SmallIndicatorChart_MouseMove);
            smallIndicatorChart.MouseLeave     += new EventHandler(SmallIndicatorChart_MouseLeave);
            toolTip.SetToolTip(smallIndicatorChart, Language.T("Click to view the full chart."));

            pnlMarket.Resize += new EventHandler(pnlMarket_Resize);

            return;
        }