public Company(string bi, string b, string c, string i, string ind, string n, string s, string z, Index bench) : base(bi, b, c, i, ind, n, s, z) { benchId = bi; benchmark = b; industry = ind; sector = s; index = bench; relativePerf = new List<double>(); /* country = c; id = i; name = n; zone = z; urlTemplate = "http://real-chart.finance.yahoo.com/table.csv?s=" + id; */ }
Index CreateBenchmark(string country,string benchId, string benchmark,string zone) { Index index = new Index(country, benchId, benchmark, zone); bool newStock=true; int i = 0; while (newStock && i < equities.Count()) { if( equities.ElementAt(i) is Index) newStock = !(equities.ElementAt(i).Equals((Object)index)); i++; } if (newStock) { if (index.Download(start, end)) equities.Add(index); } else i--; return (Index)equities.ElementAt(i); }