예제 #1
0
        public void Two_UpBars_Should_be_Contintuation()
        {
            PatternAnalyzer ptal = new PatternAnalyzer();
            Bar             bar1 = new Bar(5, 10, 0, 7, 0, DateTime.Now, DateTime.Now);

            ptal.AddBar(bar1);
            Bar bar2 = new Bar(6, 11, 1, 8, 0, DateTime.Now, DateTime.Now, bar1);

            ptal.AddBar(bar2);

            Assert.AreEqual(PatternState.Continuation, ptal.LastPattern.State);
        }
예제 #2
0
        public void Two_UpBars_One_Violating_DownBar_Should_be_DownPattern()
        {
            PatternAnalyzer ptal = new PatternAnalyzer();
            Bar             bar1 = new Bar(5, 10, 0, 7, 0, DateTime.Now, DateTime.Now);

            ptal.AddBar(bar1);
            Bar bar2 = new Bar(10, 15, 5, 12, 0, DateTime.Now, DateTime.Now, bar1);

            ptal.AddBar(bar2);
            Bar bar3 = new Bar(4, 9, -1, 6, 0, DateTime.Now, DateTime.Now, bar2);

            ptal.AddBar(bar3);

            Assert.AreEqual(PatternDirection.Down, ptal.LastPattern.Direction);
        }
예제 #3
0
        public void Two_UpBars_With_One_NonViolating_DownBar_Should_be_PullBack()
        {
            PatternAnalyzer ptal = new PatternAnalyzer();
            Bar             bar1 = new Bar(5, 10, 0, 7, 0, DateTime.Now, DateTime.Now);

            ptal.AddBar(bar1);
            Bar bar2 = new Bar(10, 15, 5, 12, 0, DateTime.Now, DateTime.Now, bar1);

            ptal.AddBar(bar2);
            Bar bar3 = new Bar(9, 12, 2, 7, 0, DateTime.Now, DateTime.Now, bar2);

            ptal.AddBar(bar3);

            Assert.AreEqual(PatternState.PullBack, ptal.LastPattern.State);
        }