Esempio n. 1
0
        public void InitializeTickDay()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 2, 0, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 3, 0, 0, 0);
            expected.TickTime = new TimeStamp("2005-05-02 03:01:34.606");
            BarsList bars = logic.openDayBars;

            TestBar(bars, expected, bars[0]);
        }
Esempio n. 2
0
        public void InitializeTickHour()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp("2005-05-02 03:00:00.000");
            expected.EndTime  = new TimeStamp("2005-05-02 04:00:00.000");
            expected.TickTime = new TimeStamp("2005-05-02 03:01:34.606");
            BarsList bars = logic.openHourBars;

            TestBar(bars, expected, bars[0]);
        }
Esempio n. 3
0
        private void TestBar(BarsList bars, Bar expected, Bar bar)
        {
//			for( int i=0; i<bars.Count;i++) {
//				log.WriteFile(i+": Time="+bars[i].Time+"/"+bars[i].EndTime);
//			}
            Assert.AreEqual(expected.Time, bar.Time, "Time");
            Assert.AreEqual(expected.EndTime, bar.EndTime, "EndTime");
            Assert.AreEqual(expected.TickTime, bar.TickTime, "TickTime");
            Assert.AreEqual(expected.Open, bar.Open, "Open");
            Assert.AreEqual(expected.High, bar.High, "High");
            Assert.AreEqual(expected.Low, bar.Low, "Low");
            Assert.AreEqual(expected.Close, bar.Close, "Close");
        }
        public void MinuteClose30()
        {
            BarsList bars     = weeklogic.closeMinute30Bars;
            Bar      expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 15, 50, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 16, 20, 0);
            expected.TickTime = new TimeStamp("2005-05-31 15:59:50.027");
            expected.Open     = 108.43;
            expected.High     = 108.48;
            expected.Low      = 108.41;
            expected.Close    = 108.45;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 5
0
        public void MinuteOpen30()
        {
            BarsList bars     = weeklogic.openMinute30Bars;
            Bar      expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 15, 50, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 16, 20, 0);
            expected.TickTime = new TimeStamp(2005, 5, 31, 15, 50, 22, 129);
            expected.Open     = 108.43;
            expected.High     = 108.43;
            expected.Low      = 108.43;
            expected.Close    = 108.43;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 6
0
        public void MinuteClose30()
        {
            BarsList bars     = weeklogic.closeMinute30Bars;
            Bar      expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 15, 20, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 15, 50, 0);
            expected.TickTime = new TimeStamp("2005-05-31 15:49:55.113");
            expected.Open     = 108.34;
            expected.High     = 108.51;
            expected.Low      = 108.32;
            expected.Close    = 108.42;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 7
0
        public void MinuteOpen()
        {
            BarsList bars     = weeklogic.openMinuteBars;
            Bar      expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 15, 59, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 16, 0, 0);
            expected.TickTime = new TimeStamp(2005, 5, 31, 15, 59, 06, 877);
            expected.Open     = 108.48;
            expected.High     = 108.48;
            expected.Low      = 108.48;
            expected.Close    = 108.48;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 8
0
        public void MinuteClose()
        {
            BarsList bars     = weeklogic.closeMinuteBars;
            Bar      expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 15, 58, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 15, 59, 0);
            expected.TickTime = new TimeStamp("2005-05-31 15:58:52.848");
            expected.Open     = 108.46;
            expected.High     = 108.48;
            expected.Low      = 108.46;
            expected.Close    = 108.47;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 9
0
        public void WeekOpen()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 29, 0, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 6, 5, 0, 0, 0);
            expected.TickTime = new TimeStamp(2005, 5, 30, 7, 0, 15, 339);
            BarsList bars = weeklogic.openWeekBars;

            expected.Open  = 107.84;
            expected.High  = 107.84;
            expected.Low   = 107.84;
            expected.Close = 107.84;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 10
0
        public void HourOpen()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 15, 20, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 16, 20, 0);
            expected.TickTime = new TimeStamp(2005, 5, 31, 15, 20, 01, 991);
            expected.Open     = 108.34;
            expected.High     = 108.34;
            expected.Low      = 108.34;
            expected.Close    = 108.34;
            BarsList bars = weeklogic.openHourBars;

            TestBar(bars, expected, bars[0]);
        }
Esempio n. 11
0
        public void HourClose()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 15, 20, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 16, 20, 0);
            expected.TickTime = new TimeStamp("2005-05-31 15:59:50.027");
            expected.Open     = 108.34;
            expected.High     = 108.51;
            expected.Low      = 108.32;
            expected.Close    = 108.45;
            BarsList bars = weeklogic.closeHourBars;

            TestBar(bars, expected, bars[0]);
        }
Esempio n. 12
0
        public void InitializeTickMinute()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 2, 7, 1, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 2, 7, 2, 0);
            expected.TickTime = new TimeStamp(2005, 5, 2, 7, 1, 34, 606);
            BarsList bars = logic.openMinuteBars;

            expected.Open  = 105.31;
            expected.High  = 105.31;
            expected.Low   = 105.31;
            expected.Close = 105.31;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 13
0
        public void SessionClose()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 6, 20, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 15, 0, 0);
            expected.TickTime = new TimeStamp("2005-05-31 15:59:50.027");
            BarsList bars = weeklogic.closeSessionBars;

            expected.Open  = 108.00;
            expected.High  = 108.32;
            expected.Low   = 107.71;
            expected.Close = 108.30;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 14
0
        public void DayOpen()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 0, 0, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 6, 1, 0, 0, 0);
            expected.TickTime = new TimeStamp(2005, 5, 31, 7, 0, 2, 910);
            expected.Open     = 108.0;
            expected.High     = 108.0;
            expected.Low      = 108.0;
            expected.Close    = 108.0;
            BarsList bars = weeklogic.openDayBars;

            TestBar(bars, expected, bars[0]);
        }
Esempio n. 15
0
        public void MonthOpen()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 1, 0, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 6, 1, 0, 0, 0);
            expected.TickTime = new TimeStamp(2005, 5, 2, 7, 1, 34, 606);
            BarsList bars = weeklogic.openMonthBars;

            expected.Open  = 105.31;
            expected.High  = 105.31;
            expected.Low   = 105.31;
            expected.Close = 105.31;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 16
0
        public void WeekClose()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 29, 0, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 6, 05, 0, 0, 0);
            expected.TickTime = new TimeStamp("2005-05-31 15:59:50.027");
            BarsList bars = weeklogic.closeWeekBars;

            expected.Open  = 107.84;
            expected.High  = 108.51;
            expected.Low   = 107.71;
            expected.Close = 108.47;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 17
0
        public void WeekClose()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 22, 0, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 29, 0, 0, 0);
            expected.TickTime = new TimeStamp("2005-05-27 15:59:58.878");
            BarsList bars = weeklogic.closeWeekBars;

            expected.Open  = 107.86;
            expected.High  = 108.25;
            expected.Low   = 107.21;
            expected.Close = 107.97;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 18
0
        public void SessionClose()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 30, 6, 20, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 30, 15, 0, 0);
            expected.TickTime = new TimeStamp("2005-05-30 11:59:43.211");
            BarsList bars = weeklogic.closeSessionBars;

            expected.Open  = 107.84;
            expected.High  = 107.97;
            expected.Low   = 107.81;
            expected.Close = 107.88;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 19
0
        public void SessionOpen()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 6, 20, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 15, 0, 0);
            expected.TickTime = new TimeStamp(2005, 5, 31, 7, 0, 2, 910);
            BarsList bars = weeklogic.openSessionBars;

            expected.Open  = 108.00;
            expected.High  = 108.00;
            expected.Low   = 108.00;
            expected.Close = 108.00;
            TestBar(bars, expected, bars[0]);
        }
Esempio n. 20
0
        public void HourClose()
        {
            Bar expected = new Bar();

            expected.Time     = new TimeStamp(2005, 5, 31, 14, 20, 0, 0);
            expected.EndTime  = new TimeStamp(2005, 5, 31, 15, 20, 0);
            expected.TickTime = new TimeStamp("2005-05-31 15:19:44.966");
            expected.Open     = 108.16;
            expected.High     = 108.33;
            expected.Low      = 108.15;
            expected.Close    = 108.33;
            BarsList bars = weeklogic.closeHourBars;

            TestBar(bars, expected, bars[0]);
        }
Esempio n. 21
0
 private void TestBar(BarsList bars, Bar expected, Bar bar)
 {
     Assert.AreEqual(expected.Time, bar.Time, "Time");
     Assert.AreEqual(expected.EndTime, bar.EndTime, "EndTime");
     Assert.AreEqual(expected.TickTime, bar.TickTime, "TickTime");
 }