code: def parse_args(pargs=None):
      parser = argparse.ArgumentParser(
          formatter_class=argparse.ArgumentDefaultsHelpFormatter,
          description="Sample after post at keithselover.wordpress.com",
      )
  
      parser.add_argument(
          "--data", required=False, default="XOM", help="Yahoo Ticker"
      )
  
      parser.add_argument(
          "--fromdate",
          required=False,
          default="2012-09-01",
          help="Ending date in YYYY-MM-DD format",
      )
  
      parser.add_argument(
          "--todate",
          required=False,
          default="2016-01-01",
          help="Ending date in YYYY-MM-DD format",
      )
  
      parser.add_argument(
          "--cash",
          required=False,
          action="store",
          type=float,
          default=100000,
          help=("Cash to start with"),
      )
  
      parser.add_argument(
          "--stake",
          required=False,
          action="store",
          type=int,
          default=100,
          help=("Cash to start with"),
      )
  
      parser.add_argument(
          "--coc",
          required=False,
          action="store_true",
          help=("Buy on close of same bar as order is issued"),
      )
  
      parser.add_argument(
          "--strat",
          required=False,
          action="store",
          default="",
          help=("Arguments for the strategy"),
      )
  
      parser.add_argument(
          "--plot",
          "-p",
          nargs="?",
          required=False,
          metavar="kwargs",
          const="{}",
          help=(
              "Plot the read data applying any kwargs passed\n"
              "\n"
              "For example:\n"
              "\n"
              '  --plot style="candle" (to plot candles)\n'
          ),
      )
  
      return parser.parse_args(pargs)
  
file_path: backtrader/samples/kselrsi/ksignal.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import backtrader
label_desc: Use image node_id 2 for calling a global function with example usage: parse_args(pargs) and returns: parser