Ejemplo n.º 1
0
    def test_get_low_liquidity_transactions(self, expected, last_n_days):
        txn_daily = DataFrame(data=[[1, 1000000, 1, 'A'],
                                    [2, 2000000, 1, 'B'],
                                    [1, 1000000, 1, 'A']],
                              columns=['sid', 'amount', 'price', 'symbol'],
                              index=self.dates)

        llt = get_low_liquidity_transactions(txn_daily, self.market_data,
                                             last_n_days=last_n_days)
        expected.index.name = 'symbol'
        assert_frame_equal(llt, expected)
Ejemplo n.º 2
0
    def test_get_low_liquidity_transactions(self, expected, last_n_days):
        txn_daily = DataFrame(data=[[1, 1000000, 1, 'A'],
                                    [2, 2000000, 1, 'B'],
                                    [1, 1000000, 1, 'A']],
                              columns=['sid', 'amount', 'price', 'symbol'],
                              index=self.dates)

        llt = get_low_liquidity_transactions(txn_daily, self.market_data,
                                             last_n_days=last_n_days)
        expected.index.name = 'symbol'
        assert_frame_equal(llt, expected)
Ejemplo n.º 3
0
    def test_get_low_liquidity_transactions(self, expected, last_n_days):
        txn_daily = pd.DataFrame(
            data=[
                [1, 1000000, 1, "A"],
                [2, 2000000, 1, "B"],
                [1, 1000000, 1, "A"],
            ],
            columns=["sid", "amount", "price", "symbol"],
            index=self.dates,
        )

        llt = get_low_liquidity_transactions(txn_daily,
                                             self.market_data,
                                             last_n_days=last_n_days)
        expected.index.name = "symbol"
        assert_frame_equal(llt, expected)