Example #1
0
        public void testMarketPeriods()
        {
            var testSymbol = new Symbol("CDS.TEST.CAH.5Y.ACB20");

            IsTrue(testSymbol.isPeriodStart(O.date("2003-06-25")));
            IsTrue(testSymbol.isPeriodStart(O.date("2008-06-01")));
            IsTrue(testSymbol.isPeriodEnd(O.date("2007-10-10")));

            IsFalse(testSymbol.isPeriodStart(O.date("2003-06-26")));
            IsFalse(testSymbol.isPeriodEnd(O.date("2009-01-01")));

            IsTrue(testSymbol.isPeriodInactive(O.date("2007-10-11")));
            IsFalse(testSymbol.isPeriodInactive(O.date("2007-10-10")));

            MarketHistoryTable.MARKET_HISTORY.insert(
                new systemdb.metadata.Market(testSymbol.name), null, O.jDate("1980-06-30"));
            Symbol.clearPeriodsCache();
            IsFalse(testSymbol.isPeriodInactive(O.date("1980-06-29")));
            IsFalse(testSymbol.isPeriodInactive(O.date("2008-06-30")));
        }