code: def run_system(model, system, group, intraday=False, quantity=1):
      r"""Run a system for a given group, creating a trades frame.
  
      Parameters
      ----------
      model : alphapy.Model
          The model object with specifications.
      system : alphapy.System
          The system to run.
      group : alphapy.Group
          The group of symbols to trade.
      intraday : bool, optional
          If true, this is an intraday system.
      quantity : float, optional
          The amount to trade for each symbol, e.g., number of shares
  
      Returns
      -------
      tf : pandas.DataFrame
          All of the trades for this ``group``.
  
      """
  
      system_name = system.name
      logger.info("Generating Trades for System %s", system_name)
  
      # Unpack the model data.
  
      directory = model.specs["directory"]
      extension = model.specs["extension"]
      separator = model.specs["separator"]
  
      # Extract the group information.
  
      gname = group.name
      gmembers = group.members
      gspace = group.space
  
      # Run the system for each member of the group
  
      gtlist = []
      for symbol in gmembers:
          # generate the trades for this member
          tlist = trade_system(
              model, system, gspace, intraday, symbol, quantity
          )
          if tlist:
              # add trades to global trade list
              for item in tlist:
                  gtlist.append(item)
          else:
              logger.info("No trades for symbol %s", symbol)
  
      # Create group trades frame
  
      tf = None
      if gtlist:
          tspace = Space(system_name, "trades", group.space.fractal)
          gtlist = sorted(gtlist, key=lambda x: x[0])
          tf = DataFrame.from_dict(
              dict(gtlist), orient="index", columns=Trade.states
          )
          tfname = frame_name(gname, tspace)
          system_dir = SSEP.join([directory, "systems"])
          labels = ["date"]
          if intraday:
              labels.append("time")
          write_frame(
              tf,
              system_dir,
              tfname,
              extension,
              separator,
              index=True,
              index_label=labels,
          )
          del tspace
      else:
          logger.info("No trades were found")
  
      # Return trades frame
      return tf
  
imports: from alphapy.frame import Frame
  from alphapy.frame import frame_name
  from alphapy.frame import read_frame
  from alphapy.frame import write_frame
  from alphapy.globals import Orders
  from alphapy.globals import BSEP, SSEP
  from alphapy.variables import vexec
  from alphapy.space import Space
  from alphapy.portfolio import Trade
  from alphapy.utilities import most_recent_file
  import logging
  import numbers
  import pandas
  from pandas import DataFrame
label_desc: Use image node_id 2 for calling a global function with example usage: run_system(model, system, group, intraday, quantity) and returns: tf