예제 #1
0
파일: TopFlop.cs 프로젝트: riyanhax/Maui
        private Result GetYield(StockHandle stock)
        {
            var series = MauiX.Query.GetStockPrices(stock,
                                                    new DateClause(DateTimeExtensions.FirstOfYear(Year), DateTimeExtensions.LastOfYear(Year)),
                                                    Timeframes.DAY);

            if (series.Count <= 2)
            {
                Console.WriteLine("Not enough data for: " + stock);
                return(null);
            }

            return(new Result()
            {
                Stock = stock,
                YearYield = MauiX.Calc.Yield(series.First, series.Last),
                DecemberYield = CalculateDecemberYield(series),
            });
        }