예제 #1
0
        public void Push(CLineContents lc)
        {
            lstLc.Add(lc);

            // decrease
            nd.CheckDecrease(lc);
            if (nd.stop)
            {
                lstTest.Add(nd);
                nd = new NumDecreaseTest();
                nd.CheckDecrease(lc);
            }

            for (int i = lstTest.Count - 1; i >= 0; --i)
            {
                lstTest[i].CheckDecrease(lc);
                if (lstTest[i].checkCount <= 0)
                {
                    lstResult.Add(lstResult[i]);
                    lstTest.RemoveAt(i);
                }
            }

            // extremum
            if (MaxNum < lc.chg_num)
            {
                MaxNum = lc.chg_num;
            }
            if (MinNum > lc.chg_num)
            {
                MinNum = lc.chg_num;
            }
            if (MaxPrice < lc.last)
            {
                MaxPrice = lc.last;
            }
            if (MinPrice > lc.last)
            {
                MinPrice = lc.last;
            }

            // average
            if (lstAverage.Count > 0)
            {
                lstAverage[lstAverage.Count - 1].tomorrowRate = lc.rate;
            }

            lstAverage.Add(new CAverageValue(lc));
        }
예제 #2
0
        public void Push(CLineContents lc)
        {
            lstLc.Add(lc);

            // decrease
            nd.CheckDecrease(lc);
            if (nd.stop)
            {
                lstTest.Add(nd);
                nd = new NumDecreaseTest();
                nd.CheckDecrease(lc);
            }

            for (int i = lstTest.Count - 1; i >= 0; --i)
            {
                lstTest[i].CheckDecrease(lc);
                if (lstTest[i].checkCount <= 0)
                {
                    lstResult.Add(lstResult[i]);
                    lstTest.RemoveAt(i);
                }
            }

            // extremum
            if (MaxNum < lc.chg_num)
            {
                MaxNum = lc.chg_num;
            }
            if (MinNum > lc.chg_num)
            {
                MinNum = lc.chg_num;
            }
            if (MaxPrice < lc.last)
            {
                MaxPrice = lc.last;
            }
            if (MinPrice > lc.last)
            {
                MinPrice = lc.last;
            }

            // average
            if (lstAverage.Count > 0)
                lstAverage[lstAverage.Count - 1].tomorrowRate = lc.rate;

            lstAverage.Add(new CAverageValue(lc));
        }