code: def mcgd(close, length=None, offset=None, c=None, **kwargs):
      """Indicator: McGinley Dynamic Indicator"""
      # Validate arguments
      length = int(length) if length and length > 0 else 10
      c = float(c) if c and 0 < c <= 1 else 1
      close = verify_series(close, length)
      offset = get_offset(offset)
  
      if close is None:
          return
  
      # Calculate Result
      close = close.copy()
  
      def mcg_(series):
          denom = c * length * (series.iloc[1] / series.iloc[0]) ** 4
          series.iloc[1] = series.iloc[0] + (
              (series.iloc[1] - series.iloc[0]) / denom
          )
          return series.iloc[1]
  
      mcg_cell = (
          close[0:].rolling(2, min_periods=2).apply(mcg_, raw=False)
      )
      mcg_ds = close[:1].append(mcg_cell[1:])
  
      # Offset
      if offset != 0:
          mcg_ds = mcg_ds.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          mcg_ds.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          mcg_ds.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name & Category
      mcg_ds.name = f"MCGD_{length}"
      mcg_ds.category = "overlap"
  
      return mcg_ds
  
label_desc: Use image node_id 1 for calling a global function with example usage: mcgd(close, length, offset, c) and returns: mcg_ds, series