Esempio n. 1
0
        private void liveQuotesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frm_LiveQuotes newMDIchild = new frm_LiveQuotes();

            newMDIchild.MdiParent = this;
            newMDIchild.Show();
            liveQuotesToolStripMenuItem.Enabled = false;
        }
Esempio n. 2
0
        private void frm_mainForm_Load(object sender, EventArgs e)
        {
            BuildMenuItems();
            this.Text = User.curName + ", " + User.curUsername;

            toolStripStatusLabel_date.Text        = DateTime.Now.ToLongDateString();
            toolStripStatusLabel_connection.Text  = "Not connected";
            toolStripStatusLabel_connection.Image = Properties.Resources.conLOST;
            isConnected = false;


            ArrayList quoteList = DataBase.getUsersQuoteList(User.curUsername);

            foreach (String quote in quoteList)
            {
                Quotes.Add(quote, new Candle());
            }

            frm_LiveQuotes newMDIchild = new frm_LiveQuotes();

            newMDIchild.MdiParent = this;
            newMDIchild.Show();

            frm_LiveNews newMDIchild2 = new frm_LiveNews();

            newMDIchild2.MdiParent = this;
            newMDIchild2.Show();

            frm_Alerts newMDIchild3 = new frm_Alerts();

            newMDIchild3.MdiParent = this;
            newMDIchild3.Show();

            alertsToolStripMenuItem.Enabled     = false;
            liveQuotesToolStripMenuItem.Enabled = false;
            newsToolStripMenuItem.Enabled       = false;

            ArrayList DefaultChartList = DataBase.getDefaultChartList();

            foreach (String symbol in DefaultChartList)
            {
                ChartControl chartControl = new ChartControl();
                chartControl.Symbol = symbol;
                frm_chart newMDIchild4 = new frm_chart(chartControl);
                newMDIchild4.MdiParent = this;
                newMDIchild4.Show();
            }

            this.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical);
        }
Esempio n. 3
0
        private void btn_addalert_Click(object sender, EventArgs e)
        {
            if (cmbbx_symbol.SelectedIndex == -1)
            {
                return;
            }

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (cmbbx_symbol.SelectedItem.ToString() == row.Cells[0].Value.ToString())
                {
                    return;
                }
            }

            if (cmbbx_symbol.SelectedIndex == -1)
            {
                return;
            }

            if (txt_targetPrice.Text == "")
            {
                return;
            }

            string result = "";

            foreach (Form form in this.MdiParent.MdiChildren)
            {
                if (form.Name == "frm_LiveQuotes")
                {
                    frm_LiveQuotes frm = (frm_LiveQuotes)form;
                    result = frm.getQuote(cmbbx_symbol.SelectedItem.ToString());
                    break;
                }
            }

            DataBase.addNewAlert(User.curUsername, cmbbx_symbol.SelectedItem.ToString(), Convert.ToDouble(txt_targetPrice.Text));
            dataGridView1.Rows.Add(cmbbx_symbol.SelectedItem, result, txt_targetPrice.Text);
            txt_targetPrice.Clear();
        }
Esempio n. 4
0
        public void DownloadComplete(Object sender, DownloadStringCompletedEventArgs e, String symbol)
        {
            if (!e.Cancelled && e.Error == null)
            {
                string        result  = (string)e.Result;
                MemoryStream  ms      = new MemoryStream(System.Text.Encoding.Default.GetBytes(result));
                DataProcessor dp      = new DataProcessor();
                ArrayList     candles = dp.getHistory(ms, 60);
                foreach (Form frm in Application.OpenForms)
                {
                    if (frm.Name == symbol)
                    {
                        frm_chart form = (frm_chart)frm;
                        form.dispayChart(form.ChartControl, candles);
                    }

                    if (frm.Name == "frm_mainForm")
                    {
                        frm_mainForm form = (frm_mainForm)frm;
                        form.isConnected = true;
                    }

                    if (frm.Name == "frm_LiveQuotes")
                    {
                        frm_LiveQuotes form = (frm_LiveQuotes)frm;
                        form.update(symbol, (Candle)candles[candles.Count - 1]);
                    }

                    if (frm.Name == "frm_Alerts")
                    {
                        frm_Alerts form = (frm_Alerts)frm;
                        form.update(symbol, (Candle)candles[candles.Count - 1]);
                    }
                }
            }
        }
Esempio n. 5
0
 private void liveQuotesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     frm_LiveQuotes newMDIchild = new frm_LiveQuotes();
     newMDIchild.MdiParent = this;
     newMDIchild.Show();
     liveQuotesToolStripMenuItem.Enabled = false;
 }
Esempio n. 6
0
        private void frm_mainForm_Load(object sender, EventArgs e)
        {
            BuildMenuItems();
            this.Text = User.curName + ", " + User.curUsername;

            toolStripStatusLabel_date.Text = DateTime.Now.ToLongDateString();
            toolStripStatusLabel_connection.Text = "Not connected";
            toolStripStatusLabel_connection.Image = Properties.Resources.conLOST;
            isConnected = false;

            ArrayList quoteList = DataBase.getUsersQuoteList(User.curUsername);
            foreach (String quote in quoteList)
            {
                Quotes.Add(quote, new Candle());
            }

            frm_LiveQuotes newMDIchild = new frm_LiveQuotes();
            newMDIchild.MdiParent = this;
            newMDIchild.Show();

            frm_LiveNews newMDIchild2 = new frm_LiveNews();
            newMDIchild2.MdiParent = this;
            newMDIchild2.Show();

            frm_Alerts newMDIchild3 = new frm_Alerts();
            newMDIchild3.MdiParent = this;
            newMDIchild3.Show();

            alertsToolStripMenuItem.Enabled = false;
            liveQuotesToolStripMenuItem.Enabled = false;
            newsToolStripMenuItem.Enabled = false;

            ArrayList DefaultChartList = DataBase.getDefaultChartList();

            foreach (String symbol in DefaultChartList)
            {
                ChartControl chartControl = new ChartControl();
                chartControl.Symbol = symbol;
                frm_chart newMDIchild4 = new frm_chart(chartControl);
                newMDIchild4.MdiParent = this;
                newMDIchild4.Show();
            }

            this.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical);
        }