Пример #1
0
        private void LiveQuotes_Load(object sender, EventArgs e)
        {
            foreach (DictionaryEntry quote in frm_mainForm.Quotes)
            {
                ArrayList candles    = Data.getDataFromGoogle("", quote.Key.ToString(), "10d", 86400);
                double    todaysOpen = ((Candle)candles[candles.Count - 2]).Close;
                dataGridView1.Rows.Add(quote.Key.ToString(), null, null, DateTime.Now.ToShortTimeString(), todaysOpen);
            }

            frm_Alerts alerts = new frm_Alerts();

            alerts.Tag = dataGridView1;

            foreach (DataGridViewColumn column in dataGridView1.Columns)
            {
                column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            }

            dataGridView1.AutoResizeRows(DataGridViewAutoSizeRowsMode.DisplayedCells);

            foreach (DictionaryEntry quote in frm_mainForm.Quotes)
            {
                Data df = new Data();
                df.getDataFromGoogle_Async("", quote.Key.ToString(), "3d", 60);
            }

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                row.DefaultCellStyle.BackColor = Color.Yellow;
            }
        }
Пример #2
0
        void addSymbol_Click(object sender, EventArgs e)
        {
            String NewSymbol = Interaction.InputBox("Enter symbol to be add in the quotes list", "Enter new symbol", string.Empty, -1, -1).ToUpper();

            if (frm_mainForm.Quotes.ContainsKey(NewSymbol))
            {
                MessageBox.Show(NewSymbol + "is allready in the quotes list!");
            }
            else
            {
                try
                {
                    ArrayList candles    = Data.getDataFromGoogle("", NewSymbol, "10d", 86400);
                    double    todaysOpen = ((Candle)candles[candles.Count - 2]).Close;
                    frm_mainForm.Quotes.Add(NewSymbol, new Candle());
                    dataGridView1.Rows.Add(NewSymbol, null, null, DateTime.Now.ToShortTimeString(), todaysOpen);
                    dataGridView1.Rows[dataGridView1.Rows.Count - 1].DefaultCellStyle.BackColor = Color.Yellow;

                    Data df = new Data();
                    df.getDataFromGoogle_Async("", NewSymbol, "3d", 60);
                    DataBase.addUserQuotes(User.curUsername, NewSymbol);
                }
                catch { MessageBox.Show(NewSymbol + " no such symbol listed!"); }
            }

            dataGridView1.AutoResizeRows(DataGridViewAutoSizeRowsMode.DisplayedCells);
        }
Пример #3
0
 private ArrayList getChartData()
 {
     if (!chartControl.Online)
     {
         return(DataBase.getChartData(chartControl.Symbol));
     }
     else
     {
         return(Data.getDataFromGoogle("", this.Name, "2d", 60));
     }
 }
Пример #4
0
        private void Alerts_Load(object sender, EventArgs e)
        {
            System.Collections.ICollection Quotes = frm_mainForm.Quotes.Keys;
            foreach (String str in Quotes)
            {
                cmbbx_symbol.Items.Add(str);
            }
            this.Name         = "frm_Alerts";
            this.AcceptButton = btn_addalert;

            ArrayList AlertList = DataBase.getUserAlerts(User.curUsername);
            double    lastPrice;

            foreach (Alert alert in AlertList)
            {
                ArrayList candles = Data.getDataFromGoogle("", alert.Symbol, "10d", 86400);
                lastPrice = ((Candle)candles[candles.Count - 2]).Close;
                dataGridView1.Rows.Add(alert.Symbol, lastPrice, alert.Target);
            }
        }