Ejemplo n.º 1
0
        private void ProcessTableWeekly()
        {
            RecMktDay day = (RecMktDay)null;

            _result = new MsMktList();
            int    num1 = -1;
            double num2 = 0.0;

            if (_dlyList.Reset())
            {
                do
                {
                    RecMktDay get      = _dlyList.Get;
                    RecDay    dtd      = get.dtd;
                    DateTime  dateTime = DateTime.FromOADate((double)get.dtd.d);
                    if (day == null)
                    {
                        day       = new RecMktDay(dtd);
                        day.dtd.v = 0.0f;
                        day.dtd.i = 0.0f;
                        num1      = -1;
                        num2      = (double)get.dtd.d;
                    }

                    if (dateTime.DayOfWeek <= (DayOfWeek)num1 || (double)get.dtd.d - num2 > 6.0)
                    {
                        _result.Add(ref day);
                        day       = new RecMktDay(dtd);
                        day.dtd.v = 0.0f;
                        day.dtd.i = 0.0f;
                    }

                    if ((double)dtd.h > (double)day.dtd.h)
                    {
                        day.dtd.h = dtd.h;
                    }
                    if ((double)dtd.l < (double)day.dtd.l)
                    {
                        day.dtd.l = dtd.l;
                    }
                    day.dtd.c  = dtd.c;
                    day.dtd.d  = dtd.d;
                    day.dtd.v += dtd.v;
                    day.dtd.i  = dtd.i;
                    num1       = (int)dateTime.DayOfWeek;
                    num2       = (double)dtd.d;
                } while (_dlyList.Next());
            }

            if (day == null)
            {
                return;
            }
            _result.Add(ref day);
        }
Ejemplo n.º 2
0
 public void Add(RecMktDay dtdDay)
 {
     _dlyList.Add(ref dtdDay);
 }
Ejemplo n.º 3
0
        private void ProcessTableMonthly()
        {
            RecMktDay day      = (RecMktDay)null;
            int       num1     = 0;
            int       num2     = 0;
            DateTime  minValue = DateTime.MinValue;

            _result = new MsMktList();
            if (!_dlyList.Reset())
            {
                return;
            }
            do
            {
                RecMktDay get      = _dlyList.Get;
                RecDay    dtd      = get.dtd;
                DateTime  dateTime = DateTime.FromOADate((double)get.dtd.d);
                DateTime  date1;
                if (day == null)
                {
                    day       = new RecMktDay(dtd);
                    day.dtd.v = 0.0f;
                    day.dtd.i = 0.0f;
                    date1     = dateTime.Date;
                    num1      = date1.Month;
                    date1     = dateTime.Date;
                    num2      = date1.Year;
                }

                date1 = dateTime.Date;
                if (date1.Month == num1)
                {
                    date1 = dateTime.Date;
                    if (date1.Year == num2)
                    {
                        goto label_6;
                    }
                }

                date1 = dateTime.Date;
                num1  = date1.Month;
                date1 = dateTime.Date;
                num2  = date1.Year;
                _result.Add(ref day);
                day       = new RecMktDay(dtd);
                day.dtd.v = 0.0f;
                day.dtd.i = 0.0f;
label_6:
                if ((double)dtd.h > (double)day.dtd.h)
                {
                    day.dtd.h = dtd.h;
                }
                if ((double)dtd.l < (double)day.dtd.l)
                {
                    day.dtd.l = dtd.l;
                }
                day.dtd.c  = dtd.c;
                day.dtd.d  = dtd.d;
                day.dtd.v += dtd.v;
                day.dtd.i  = dtd.i;
                DateTime date2 = dateTime.Date;
            } while (_dlyList.Next());

            if (day == null)
            {
                return;
            }
            _result.Add(ref day);
        }
Ejemplo n.º 4
0
        private void LoadDailyData(int?fjd, int?ljd)
        {
            _dlyList = new MsMktList();
            if (File.Exists(_datFilePath))
            {
                bool flag = false;
                if (!fjd.HasValue && !ljd.HasValue)
                {
                    flag = true;
                }
                else
                {
                    if (!fjd.HasValue)
                    {
                        fjd = new int?(-99999);
                    }
                    if (!ljd.HasValue)
                    {
                        ljd = new int?(99999);
                    }
                }

                _fs = new FileStream(_datFilePath, FileMode.Open, FileAccess.Read, FileShare.None);
                if (_fs.Length > 0L)
                {
                    _baseRec = new RecMsDay();
                    int num = (int)(_fs.Length / 28L) - 1;
                    ReadFromFileStream(_fs, ref _baseRec);
                    for (int index = 0; index < num; ++index)
                    {
                        RecMktDay day = new RecMktDay();
                        ReadFromFileStream(_fs, ref day.msd);
                        day.MakeDtd();
                        if (!flag)
                        {
                            int d1              = day.dtd.d;
                            int?nullable        = fjd;
                            int valueOrDefault1 = nullable.GetValueOrDefault();
                            if ((d1 >= valueOrDefault1 ? (nullable.HasValue ? 1 : 0) : 0) != 0)
                            {
                                int d2 = day.dtd.d;
                                nullable = ljd;
                                int valueOrDefault2 = nullable.GetValueOrDefault();
                                if ((d2 <= valueOrDefault2 ? (nullable.HasValue ? 1 : 0) : 0) == 0)
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }

                        _dlyList.Add(ref day);
                    }
                }

                _fs.Close();
                _dlyList.Reset();
            }

            _loaded = true;
        }