code: def class_factory(name, base_class, class_dict):
      
  
      def __init__(self, tcex):
          base_class.__init__(self, tcex)
          for k, v in class_dict.items():
              setattr(self, k, v)
  
      newclass = type(str(name), (base_class,), {'__init__': __init__})
      return newclass
docs: Internal method for dynamically building Custom Indicator classes.