Пример #1
0
        public MetaStockCollection IntersectDates()
        {
            // create valid dates list
            List <DateTime> ListaDate = this[0].GetDates();

            foreach (MetaStockTable tab in this)
            {
                ListaDate = IntersectDates(ListaDate, tab.GetDates());
            }

            // create return value (all tables)
            MetaStockCollection R = new MetaStockCollection();

            foreach (MetaStockTable tab in this)
            {
                // create single table
                MetaStockTable rt = new MetaStockTable();
                rt.Symbol = tab.Symbol;
                foreach (MetaStockRow rr in tab)
                {
                    if (ListaDate.Contains(rr.Day))
                    {
                        rt.Add(rr);
                    }
                }
                R.Add(rt);
            }
            return(R);
        }
Пример #2
0
        public MetaStockCollection FilterPeriod(DateTime Start, DateTime End)
        {
            MetaStockCollection R = new MetaStockCollection();

            foreach (MetaStockTable tab in this)
            {
                MetaStockTable newtab = tab.FilterPeriod(Start, End);
                newtab.Symbol = tab.Symbol;
                R.Add(newtab);
            }
            return(R);
        }