code: def mfi(
      high,
      low,
      close,
      volume,
      length=None,
      talib=None,
      drift=None,
      offset=None,
      **kwargs,
  ):
      """Indicator: Money Flow Index (MFI)"""
      # Validate arguments
      length = int(length) if length and length > 0 else 14
      high = verify_series(high, length)
      low = verify_series(low, length)
      close = verify_series(close, length)
      volume = verify_series(volume, length)
      drift = get_drift(drift)
      offset = get_offset(offset)
      mode_tal = bool(talib) if isinstance(talib, bool) else True
  
      if high is None or low is None or close is None or volume is None:
          return
  
      # Calculate Result
      if Imports["talib"] and mode_tal:
          from talib import MFI
  
          mfi = MFI(high, low, close, volume, length)
      else:
          typical_price = hlc3(high=high, low=low, close=close)
          raw_money_flow = typical_price * volume
  
          tdf = DataFrame(
              {"diff": 0, "rmf": raw_money_flow, "+mf": 0, "-mf": 0}
          )
  
          tdf.loc[(typical_price.diff(drift) > 0), "diff"] = 1
          tdf.loc[tdf["diff"] == 1, "+mf"] = raw_money_flow
  
          tdf.loc[(typical_price.diff(drift) < 0), "diff"] = -1
          tdf.loc[tdf["diff"] == -1, "-mf"] = raw_money_flow
  
          psum = tdf["+mf"].rolling(length).sum()
          nsum = tdf["-mf"].rolling(length).sum()
          tdf["mr"] = psum / nsum
          mfi = 100 * psum / (psum + nsum)
          tdf["mfi"] = mfi
  
      # Offset
      if offset != 0:
          mfi = mfi.shift(offset)
  
      # Handle fills
      if "fillna" in kwargs:
          mfi.fillna(kwargs["fillna"], inplace=True)
      if "fill_method" in kwargs:
          mfi.fillna(method=kwargs["fill_method"], inplace=True)
  
      # Name and Categorize it
      mfi.name = f"MFI_{length}"
      mfi.category = "volume"
  
      return mfi
  
imports: from pandas import DataFrame
  from pandas_ta import Imports
  from pandas_ta.overlap import hlc3
  from pandas_ta.utils import get_drift, get_offset, verify_series
label_desc: Use image node_id 1 for calling a global function with example usage: mfi(high, low, close, volume, length, talib, drift, offset) and returns: mfi