Ejemplo n.º 1
0
        private static ProfitAnalysis GetOptimalProfit(params TradePrice[] prices)
        {
            var set = new HashSet <TradePrice>(prices);

            var stockHistory = new StockHistory(set);

            return(stockHistory.GetOptimalProfitPeriod());
        }
Ejemplo n.º 2
0
        public void GetOptimalProfitPeriod_ShouldPriceValuesWhenTradeHistoryOfOne()
        {
            var price = TradePrice.Create(new DateTime(2010, 01, 01), 56, 93);
            var set   = new HashSet <TradePrice> {
                price
            };

            var stockHistory  = new StockHistory(set);
            var optimalProfit = stockHistory.GetOptimalProfitPeriod();

            Assert.IsTrue(ValuesEqual(price, optimalProfit));
        }