예제 #1
0
        def test_close_value(self, mock_trade_close):
            tick = TickFactory()
            trade = TradeFactory()
            trade.current_close_value = 87.9
            trade.close_from_tick(tick)

            assert mock_trade_close.call_count == 1
            assert mock_trade_close.call_args_list[0][1]["close_value"] == 87.9
예제 #2
0
    def test_nominal(self, direction, open, current, expected_result):
        trade = TradeFactory(direction=direction)
        trade.open_value = open
        trade.current_close_value = current

        assert trade.opened_result_avg == expected_result