code: def test_moving_average_convergence_divergence(
      self, seed, fast_period, slow_period, signal_period
  ):
      rng = RandomState(seed)
  
      nassets = 3
  
      macd = MovingAverageConvergenceDivergenceSignal(
          fast_period=fast_period,
          slow_period=slow_period,
          signal_period=signal_period,
      )
  
      today = pd.Timestamp("2016", tz="utc")
      assets = pd.Index(np.arange(nassets))
      out = np.empty(shape=(nassets,), dtype=np.float64)
      close = rng.rand(macd.window_length, nassets)
  
      macd.compute(
          today,
          assets,
          out,
          close,
          fast_period,
          slow_period,
          signal_period,
      )
  
      close_df = pd.DataFrame(close)
      fast_ewma = self.expected_ewma(
          close_df,
          fast_period,
      )
      slow_ewma = self.expected_ewma(
          close_df,
          slow_period,
      )
      signal_ewma = self.expected_ewma(
          fast_ewma - slow_ewma, signal_period
      )
  
      # Everything but the last row should be NaN.
      self.assertTrue(signal_ewma.iloc[:-1].isnull().all().all())
  
      # We're testing a single compute call, which we expect to be equivalent
      # to the last row of the frame we calculated with pandas.
      expected_signal = signal_ewma.values[-1]
  
      np.testing.assert_almost_equal(out, expected_signal, decimal=8)
  
imports: from __future__ import division
  from nose_parameterized import parameterized
  from six.moves import range
  import numpy
  import pandas
  import talib
  from numpy.random import RandomState
  from zipline.lib.adjusted_array import AdjustedArray
  from zipline.pipeline.data import USEquityPricing
  from zipline.pipeline.factors import BollingerBands, Aroon, FastStochasticOscillator, IchimokuKinkoHyo, LinearWeightedMovingAverage, RateOfChangePercentage, TrueRange, MovingAverageConvergenceDivergenceSignal, AnnualizedVolatility, RSI
  from zipline.testing import check_allclose, parameter_space
  from zipline.testing.fixtures import ZiplineTestCase
  from zipline.testing.predicates import assert_equal
  from .base import BaseUSEquityPipelineTestCase
label_desc: Use image node_id 4 for calling the MovingAverageConvergenceDivergenceTestCase obj's underlying member method code with example usage: obj.test_moving_average_convergence_divergence(seed, fast_period, slow_period, signal_period) without return types