Beispiel #1
0
        public close_up_percent(kdata series, DateTime since)
            : base(series)
        {
            var s = series.Where(p1 => p1.date >= since);

            if (s.Any())
            {
                var closeup = s.Count(p1 => p1.close >= p1.open);
                var total   = s.Count();

                value = Math.Round((closeup / (double)total) * 100, 2);
            }
        }
        public low_to_historical_lowest(kdata series, DateTime since)
            : base(series)
        {
            var s = series.Where(p1 => p1.date >= since);

            if (s.Any())
            {
                var current = series.Last();
                var lowest  = s.Min(p1 => p1.low);

                value = Math.Truncate((current.low / lowest - 1) * 100);
            }
        }
Beispiel #3
0
        public historical_low(kdata series, DateTime since)
            : base(series)
        {
            var s = series.Where(p1 => p1.date >= since);

            if (s.Any())
            {
                var min = double.MaxValue;
                foreach (var d in s)
                {
                    if (d.low < min)
                    {
                        min   = d.low;
                        value = d;
                    }
                }
            }
        }