Exemplo n.º 1
0
    def test_next_date(self):
        dt = Date(19, Jun, 2014)
        dt_2 = imm.next_date(dt)
        # 17 sep 2014
        self.assertEqual(dt_2, date(2014, 9, 17))

        dt_3 = imm.next_date('M9', True, today())
        # 18 sep 2019
        self.assertEqual(dt_3, date(2019, 9, 18))
Exemplo n.º 2
0
def next_imm_date(reference_date, tenor):
    """
    Third Wednesday of contract month
    """
    dt = reference_date
    for k in range(tenor):
        dt = imm.next_date(dt)
    return pydate_from_qldate(dt)
Exemplo n.º 3
0
def next_imm_date(reference_date, tenor):
    """
    Third Wednesday of contract month
    """
    dt = reference_date
    for k in range(tenor):
        dt = imm.next_date(dt)
    return pydate_from_qldate(dt)
Exemplo n.º 4
0
def next_imm_date(reference_date, tenor):
    """
    Third Wednesday of contract month
    """
    dt = qldate_from_pydate(reference_date)
    for k in range(tenor):
        tmp = imm.next_date(dt)
        dt = pydate_to_qldate(tmp)
    return pydate_from_qldate(dt)
Exemplo n.º 5
0
def next_imm_date(reference_date, tenor):
    """
    Third Wednesday of contract month
    """
    dt = qldate_from_pydate(reference_date)
    for k in range(tenor):
        tmp = imm.next_date(dt)
        dt = pydate_to_qldate(tmp)
    return pydate_from_qldate(dt)