Ejemplo n.º 1
0
    def test_days_to_liquidate_positions(self):
        dtlp = days_to_liquidate_positions(self.positions,
                                           self.market_data,
                                           max_bar_consumption=1,
                                           capital_base=1e6,
                                           mean_volume_window=1)

        expected = DataFrame([[0.0, .5 / 3], [0.75 / 2, 0.0]],
                             columns=['A', 'B'],
                             index=self.dates[1:])
        assert_frame_equal(dtlp, expected)
Ejemplo n.º 2
0
    def test_days_to_liquidate_positions(self):
        dtlp = days_to_liquidate_positions(self.positions,
                                           self.market_data,
                                           max_bar_consumption=1,
                                           capital_base=1e6,
                                           mean_volume_window=1)

        expected = DataFrame([[0.0, .5/3],
                              [0.75/2, 0.0]],
                             columns=['A', 'B'],
                             index=self.dates[1:])
        assert_frame_equal(dtlp, expected)