示例#1
0
        //public Outline this[int threshold]
        //{
        //     get
        //     {
        //         if (threshold < 1)
        //             return null;
        //         else if (threshold == Outline.DefaultThreshold)
        //             return BaseOutline;
        //         else
        //             return OutlineHelper.OutlineFromQuotes(this, threshold);
        //     }
        //}

        //public DateTimeOffset NearestOf(Double rough)
        //{
        //    if (rough <= Dates[0])
        //        return Since;
        //    else if (rough >= Dates.Last())
        //        return Until;
        //    else
        //    {
        //        Double dateValue = Dates.Find(a => a >= rough);

        //        DateTimeOffset nearest = new DateTimeOffset(DateTime.FromOADate(dateValue), TimeSpan.Zero);

        //        return nearest;
        //    }
        //}

        #endregion

        #endregion

        #region Constructors

        public QuoteCollection(string name, string source, RecordType type, List <Quote> quotes)
        {
            Name      = name;
            Source    = source;
            QuoteType = type;

            DataCollection = quotes;

            QuoteOADates = new List <double>();

            BaseOutline = OutlineHelper.OutlineFromQuotes(this, Outline.DefaultThreshold);

            summary();
        }
示例#2
0
        public QuoteCollection(QuoteCollection original, RecordType longer)
        {
            if (original.QuoteType > longer)
            {
                throw new Exception();
            }

            Name      = original.Name;
            Source    = original.Source;
            QuoteType = longer;

            QuoteOADates = new List <double>();

            DataCollection = FromShortTerms(original, longer);

            BaseOutline = OutlineHelper.OutlineFromQuotes(this, Outline.DefaultThreshold);

            summary();
        }
示例#3
0
        public static Outline OutlineFromQuotes(QuoteCollection quotes, int threshold)
        {
            OutlineHelper marker = new OutlineHelper(quotes.DataCollection, threshold);

            return(marker.TheOutline);
        }
示例#4
0
 public static Outline OutlineOf(QuoteCollection quotes, int threshold)
 {
     return(OutlineHelper.OutlineFromQuotes(quotes, threshold));
 }