code: def ha(open_, high, low, close, offset=None, **kwargs):
      """Candle Type: Heikin Ashi"""
      # Validate Arguments
      open_ = verify_series(open_)
      high = verify_series(high)
      low = verify_series(low)
      close = verify_series(close)
      offset = get_offset(offset)
  
      # Calculate Result
      m = close.size
      df = DataFrame(
          {
              "HA_open": 0.5 * (open_.iloc[0] + close.iloc[0]),
              "HA_high": high,
              "HA_low": low,
              "HA_close": 0.25 * (open_ + high + low + close),
          }
      )
  
      for i in range(1, m):
          df["HA_open"][i] = 0.5 * (
              df["HA_open"][i - 1] + df["HA_close"][i - 1]
          )
  
      df["HA_high"] = df[["HA_open", "HA_high", "HA_close"]].max(axis=1)
      df["HA_low"] = df[["HA_open", "HA_low", "HA_close"]].min(axis=1)
  
      # Offset
      if offset != 0:
          df = df.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          df.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          df.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name and Categorize it
      df.name = "Heikin-Ashi"
      df.category = "candles"
  
      return df
  
label_desc: Use image node_id 1 for calling a global function with example usage: ha(open_, high, low, close, offset) and returns: df