code: def schaff_tc(close, xmacd, tclength, factor):
      # ACTUAL Calculation part, which is shared between operation modes
      # 1St : Stochastic of MACD
      lowest_xmacd = xmacd.rolling(
          tclength
      ).min()  # min value in interval tclen
      xmacd_range = non_zero_range(
          xmacd.rolling(tclength).max(), lowest_xmacd
      )
      m = len(xmacd)
  
      # %Fast K of MACD
      stoch1, pf = list(xmacd), list(xmacd)
      stoch1[0], pf[0] = 0, 0
      for i in range(1, m):
          if lowest_xmacd[i] > 0:
              stoch1[i] = 100 * (
                  (xmacd[i] - lowest_xmacd[i]) / xmacd_range[i]
              )
          else:
              stoch1[i] = stoch1[i - 1]
          # Smoothed Calculation for % Fast D of MACD
          pf[i] = round(
              pf[i - 1] + (factor * (stoch1[i] - pf[i - 1])), 8
          )
  
      pf = Series(pf, index=close.index)
  
      # 2nd : Stochastic of smoothed Percent Fast D, 'PF', above
      lowest_pf = pf.rolling(tclength).min()
      pf_range = non_zero_range(pf.rolling(tclength).max(), lowest_pf)
  
      # % of Fast K of PF
      stoch2, pff = list(xmacd), list(xmacd)
      stoch2[0], pff[0] = 0, 0
      for i in range(1, m):
          if pf_range[i] > 0:
              stoch2[i] = 100 * ((pf[i] - lowest_pf[i]) / pf_range[i])
          else:
              stoch2[i] = stoch2[i - 1]
          # Smoothed Calculation for % Fast D of PF
          pff[i] = round(
              pff[i - 1] + (factor * (stoch2[i] - pff[i - 1])), 8
          )
  
      return [pff, pf]
  
imports: from pandas import DataFrame, Series
  from pandas_ta.overlap import ema
  from pandas_ta.utils import get_offset, non_zero_range, verify_series
label_desc: Use image node_id 2 for calling a global function with example usage: schaff_tc(close, xmacd, tclength, factor) and returns: list