예제 #1
0
    def test_handle_bar_updates_indicator(self):
        # Arrange
        indicator = RateOfChange(3)

        bar = TestStubs.bar_5decimal()

        # Act
        indicator.handle_bar(bar)

        # Assert
        assert indicator.has_inputs
        assert indicator.value == 0
예제 #2
0
    def test_handle_bar_updates_indicator(self):
        # Arrange
        indicator = RateOfChange(3)

        bar = TestStubs.bar_5decimal()

        # Act
        indicator.handle_bar(bar)

        # Assert
        self.assertTrue(indicator.has_inputs)
        self.assertEqual(0, indicator.value)