Example #1
0
        public void testLeadBars()
        {
            var a   = symbols[0];
            var b   = symbols[1];
            var bar = new Bar(0, 0, 0, 0);

            IsTrue(system().systems_[a].inLeadBars());
            IsTrue(system().systems_[b].inLeadBars());
            processBar(O.dictionaryOne(a, bar));
            IsFalse(system().systems_[a].inLeadBars());
            IsTrue(system().systems_[b].inLeadBars());
            processBar(O.dictionaryOne(b, bar));
            IsFalse(system().systems_[a].inLeadBars());
            IsFalse(system().systems_[b].inLeadBars());
        }
Example #2
0
 public void testCollectorsHaveProperDates()
 {
     bar(1, 1, 1, 1);
     bar(1, 1, 1, 1);
     processBar(O.dictionaryOne(A, new Bar(2, 2, 2, 2, current)));
     current = current.AddDays(1);
     HasCount(3, collector(A).dates());
     HasCount(2, collector(B).dates());
     HasCount(3, bridge().statistics().portfolioCollector(P1).dates());
     HasCount(2, bridge().statistics().portfolioCollector(P2).dates());
     bar(3, 3, 3, 3);
     HasCount(4, collector(A).dates());
     HasCount(3, collector(B).dates());
     HasCount(4, bridge().statistics().portfolioCollector(P1).dates());
     HasCount(3, bridge().statistics().portfolioCollector(P2).dates());
     processBar(O.dictionaryOne(C, new Bar(2, 2, 2, 2, current)));
     current = current.AddDays(1);
     HasCount(4, collector(A).dates());
     HasCount(3, collector(B).dates());
     HasCount(4, bridge().statistics().portfolioCollector(P1).dates());
     HasCount(4, bridge().statistics().portfolioCollector(P2).dates());
 }