public static StockMarketHistoricalData GetDowJonesHistoricalData() { if (CachedData != null) { return(CachedData); } // Read in data var rows = ReadInCSVFile.ReadInDowJonesFile(); Console.WriteLine("Found " + rows.Count + " days of data"); var data = new StockMarketHistoricalData(rows); CachedData = data; return(data); }
static void Main(string[] args) { // Read in data var rows = ReadInCSVFile.ReadInDowJonesFile(); Console.WriteLine("Found " + rows.Count + " days of data"); var data = new StockMarketHistoricalData(rows); //TestStrategy(new NoActionStrategy(), data); TestStrategy(new AlwaysBuyStrategy(new StandardInvestmentSchedule()), data); //TestStrategy(new AlwaysBuyStrategy(new InitialInvestmentOnly(1)), data); //foreach (DayOfWeek day in (DayOfWeek[])Enum.GetValues(typeof(DayOfWeek))) //{ // TestStrategy(new AlwaysBuyBasedOnWeekDay(new StandardInvestmentSchedule(), day), data); //} Console.ReadKey(); }