code: def parse_args():
      parser = argparse.ArgumentParser(
          description="Commission schemes",
          formatter_class=argparse.ArgumentDefaultsHelpFormatter,
      )
  
      parser.add_argument(
          "--data",
          "-d",
          default="../../datas/2006-day-001.txt",
          help="data to add to the system",
      )
  
      parser.add_argument(
          "--fromdate",
          "-f",
          default="2006-01-01",
          help="Starting date in YYYY-MM-DD format",
      )
  
      parser.add_argument(
          "--todate",
          "-t",
          default="2006-12-31",
          help="Starting date in YYYY-MM-DD format",
      )
  
      parser.add_argument(
          "--stake",
          default=1,
          type=int,
          help="Stake to apply in each operation",
      )
  
      parser.add_argument(
          "--period",
          default=30,
          type=int,
          help="Period to apply to the Simple Moving Average",
      )
  
      parser.add_argument(
          "--cash", default=10000.0, type=float, help="Starting Cash"
      )
  
      parser.add_argument(
          "--comm",
          default=2.0,
          type=float,
          help=(
              "Commission factor for operation, either a"
              "percentage or a per stake unit absolute value"
          ),
      )
  
      parser.add_argument(
          "--mult",
          default=10,
          type=int,
          help="Multiplier for operations calculation",
      )
  
      parser.add_argument(
          "--margin",
          default=2000.0,
          type=float,
          help="Margin for futures-like operations",
      )
  
      parser.add_argument(
          "--commtype",
          required=False,
          default="none",
          choices=["none", "perc", "fixed"],
          help=(
              "Commission - choose none for the old"
              " CommissionInfo behavior"
          ),
      )
  
      parser.add_argument(
          "--stocklike",
          required=False,
          action="store_true",
          help=(
              "If the operation is for stock-like assets or"
              "future-like assets"
          ),
      )
  
      parser.add_argument(
          "--percrel",
          required=False,
          action="store_true",
          help=(
              "If perc is expressed in relative xx% rather"
              "than absolute value 0.xx"
          ),
      )
  
      parser.add_argument(
          "--plot", "-p", action="store_true", help="Plot the read data"
      )
  
      parser.add_argument(
          "--numfigs",
          "-n",
          default=1,
          help="Plot using numfigs figures",
      )
  
      return parser.parse_args()
  
file_path: backtrader/samples/commission-schemes/commission-schemes.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import backtrader
  import backtrader.feeds
  import backtrader.indicators
label_desc: Use image node_id 2 for calling a global function with example usage: parse_args() and returns: parser