Example #1
0
        public QuoteCollection(QuoteCollection original, RecordType longer)
        {
            if (QuoteType > longer)
            {
                throw new Exception();
            }

            Name      = original.Name;
            QuoteType = longer;
            //DateTimeFormat = DefaultDateTimeFormats[QuoteType];

            DataCollection = FromShortTerms(original, longer);

            getCeilingFloor();

            //YData = original.YData;
            //Threshold = original.Threshold;
            LastModify       = DateTime.Now;
            ShortTermOutline = TrendMarker.OutlineFromQuotes(this, 1);
            CurrentOutline   = TrendMarker.OutlineFromQuotes(this, TrendMarker.DefaultThreshold);

            if (CurrentOutline == null)
            {
                CurrentOutline = ShortTermOutline;
            }

            OutlineValues = getDefaultValues();
            Dates         = getDates();
        }
Example #2
0
        //private List<MajorCollection> majorsCollection = new List<MajorCollection>();
        //public MajorCollection MajorsOf(int threshold)
        //{
        //    MajorCollection result = null;

        //    foreach (MajorCollection items in majorsCollection)
        //    {
        //        if (items.Threshold == threshold)
        //        {
        //            result = items;
        //        }
        //    }

        //    if (result == null)
        //    {
        //        result = new MajorCollection(DataCollection, threshold);
        //        majorsCollection.Add(result);
        //    }
        //    else if (result.LastMark < LastModify)
        //    {
        //        majorsCollection.Clear();
        //        result = new MajorCollection(DataCollection, threshold);
        //        majorsCollection.Add(result);
        //    }

        //    return result;
        //}

        //public List<OutlineItem> OutlineDictionary
        //{
        //    get { return MajorsOf(Threshold).OutlineDictionary; }
        //}

        #endregion

        #endregion

        #region Constructors

        public QuoteCollection(string name, List <Quote> quotes) //, ValueType yType)
        {
            Name = name;
            //YData = yType;
            //Threshold = TrendMarker.DefaultThreshold;

            DataCollection = quotes;
            DataCollection.Sort();
            LastModify = DateTime.Now;

            QuoteType = GuessQuoteType(DataCollection);

            ShortTermOutline = TrendMarker.OutlineFromQuotes(this, 1);
            CurrentOutline   = TrendMarker.OutlineFromQuotes(this, TrendMarker.DefaultThreshold);
            OutlineValues    = getDefaultValues();
            Dates            = getDates();
        }
Example #3
0
 public Outline OutlineOf(int threshold)
 {
     if (threshold < 1)
     {
         return(null);
     }
     else if (threshold == 1)
     {
         return(ShortTermOutline);
     }
     else if (threshold == TrendMarker.DefaultThreshold)
     {
         return(CurrentOutline);
     }
     else
     {
         return(TrendMarker.OutlineFromQuotes(this, threshold));
     }
 }