Exemple #1
0
        public void 生成(BarSeries bs)
        {
            笔 bi = new 笔();

            bars.Clear();
            blist1.Clear();
            for (int i = 0; i < bs.Count; i++)
            {
                if (i == 0)
                {/*
                  *     bi.zd = 结构.起点;
                  *     bi.o = bs[0].Close;
                  *     bi.high = 0;
                  *     bi.ba = bs[0];
                  *     bi.low = 0;
                  *     blist1.Add(bi);
                  *     bars.Add(bs[0]);*/
                }
                else
                {
                    bars.Add(bs[i]);
                    包含计算();
                }
            }
        }
Exemple #2
0
        public void TestCase()
        {
            Bar bar1 = new Bar();
            Bar bar2 = new Bar();

            bs.Add(bar1);
            bs.Add(bar2);
            Assert.AreEqual(1, bs.RealCount);
            Assert.AreSame(bar2, bs[0]);
            bs.Clear();
            Assert.AreEqual(0, bs.RealCount);

            DateTime dt1  = new DateTime(2014, 1, 1, 12, 12, 12);
            Bar      bar3 = new Bar(dt1, 10, 10, 10, 10, 100, 100);

            bs.Add(bar3);
            Assert.AreSame(bar3, bs[dt1]);
            bs.Clear();
            bs.Add(bar3);
            Assert.AreSame(bar3, bs[dt1, EIndexOption.Next]);
        }