public List <Quotation> GetQuotationFromCSVFile(string path)
        {
            string[]         lines      = File.ReadAllLines(path);
            List <Quotation> collection = new List <Quotation>();

            foreach (string line in lines)
            {
                Quotation quotation = new Quotation();
                quotation.CsvFetch(line);
                collection.Add(quotation);
            }

            return(collection);
        }
예제 #2
0
        public PriceGap(Quotation first,  Quotation second)
        {

            First = first;
            Second = second;

            double firstTop = First.GetTop();
            double firstBottom = First.GetBottom();

            double secondTop = Second.GetTop();
            double secondBottom = Second.GetBottom();

            if (secondBottom > firstTop)
            {
                Start = firstTop;
                End = secondBottom;
            }
            else if (secondTop < firstBottom)
            {
                Start = firstBottom;
                End = secondBottom;
            }

        }
        TickPeriodType getTickTypeFromQuotations(Quotation q1, Quotation q2)
        {
            TimeSpan ts        = q2.DateTime - q1.DateTime;
            int      inMinutes = ts.Minutes;

            if (inMinutes == 1)
            {
                return(TickPeriodType.Minute_1);
            }
            else if (inMinutes == 5)
            {
                return(TickPeriodType.Minute_5);
            }
            else if (inMinutes == 15)
            {
                return(TickPeriodType.Minute_15);
            }
            else if (inMinutes == 60)
            {
                return(TickPeriodType.Hour_1);
            }
            else if (inMinutes == 240)
            {
                return(TickPeriodType.Hour_4);
            }
            else if (inMinutes == 1440)
            {
                return(TickPeriodType.Day);
            }
            else if (inMinutes == 10080)
            {
                return(TickPeriodType.Week);
            }

            return(TickPeriodType.Unknown);
        }