Ejemplo n.º 1
0
        public YahooData getSeries(bool readByRange)
        {
            YahooData yd = new YahooData();
            string    stock, startDate, endDate;

            if (readByRange)
            {
                foreach (DataTable dt in dsTransaction.Tables)
                {
                    stock     = dt.TableName;
                    startDate = dt.Rows[0][0].ToString();
                    endDate   = dt.Rows[dt.Rows.Count - 1][0].ToString();

                    yd.addSeries(stock, startDate, endDate);
                }
            }
            else
            {
                foreach (DataTable dt in dsTransaction.Tables)
                {
                    stock = dt.TableName;
                    foreach (DataRow dr in dt.Rows)
                    {
                        startDate = dr[0].ToString();
                        endDate   = dr[0].ToString();

                        yd.addSeries(stock, startDate, endDate);
                    }
                }
            }

            return(yd);
        }
Ejemplo n.º 2
0
 public void setSeries(YahooData yahoodata)
 {
     foreach (Tuple <string, string, string> t in yahoodata.getSeries())
     {
         setSeries(t.Item1, t.Item2, t.Item3);
     }
 }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Transaction myTransaction = new Transaction();
            YahooData   mySeries      = myTransaction.getSeries(false);

            LineChart lc = new LineChart();

            lc.setSeries(mySeries);

            DataSet ds     = lc.getHistoricalPrices();
            DataSet dsTemp = myTransaction.consolidatedPortfolio(ds);

            myTransaction.updateTransaction(ds);

            BuildChart(chart1, dsTemp);
        }