Beispiel #1
0
    def test_handle_trade_tick_updates_with_expected_value(self):
        # Arrange
        sma_for_ticks = SimpleMovingAverage(10)

        tick = TestStubs.trade_tick_5decimal(AUDUSD_FXCM)

        # Act
        sma_for_ticks.handle_trade_tick(tick)

        # Assert
        self.assertTrue(sma_for_ticks.has_inputs)
        self.assertEqual(1.00001, sma_for_ticks.value)
    def test_handle_trade_tick_updates_with_expected_value(self):
        # Arrange
        sma_for_ticks = SimpleMovingAverage(10)

        tick = TestDataStubs.trade_tick_5decimal(AUDUSD_SIM.id)

        # Act
        sma_for_ticks.handle_trade_tick(tick)

        # Assert
        assert sma_for_ticks.has_inputs
        assert sma_for_ticks.value == 1.00001
    def test_handle_trade_tick_updates_indicator(self):
        # Arrange
        indicator = SimpleMovingAverage(10)

        tick = TestDataStubs.trade_tick_5decimal(AUDUSD_SIM.id)

        # Act
        indicator.handle_trade_tick(tick)

        # Assert
        assert indicator.has_inputs
        assert indicator.value == 1.00001
Beispiel #4
0
    def test_handle_trade_tick_updates_indicator(self):
        # Arrange
        indicator = SimpleMovingAverage(10)

        tick = TestStubs.trade_tick_5decimal(AUDUSD_SIM.symbol)

        # Act
        indicator.handle_trade_tick(tick)

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