code: def runstrat(pargs=None):
      args = parse_args(pargs)
  
      cerebro = bt.Cerebro()
      cerebro.broker.set_cash(args.cash)
      cerebro.broker.set_coc(args.coc)
      data0 = bt.feeds.YahooFinanceData(
          dataname=args.data,
          fromdate=datetime.datetime.strptime(
              args.fromdate, "%Y-%m-%d"
          ),
          todate=datetime.datetime.strptime(args.todate, "%Y-%m-%d"),
          round=False,
      )
  
      cerebro.adddata(data0)
  
      cerebro.addsizer(bt.sizers.FixedSize, stake=args.stake)
      cerebro.addstrategy(
          TheStrategy, **(eval("dict(" + args.strat + ")"))
      )
      cerebro.addobserver(bt.observers.Value)
      cerebro.addobserver(bt.observers.Trades)
      cerebro.addobserver(bt.observers.BuySell, barplot=True)
  
      cerebro.run(stdstats=False)
      if args.plot:
          cerebro.plot(**(eval("dict(" + args.plot + ")")))
  
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 1 for calling a global function with example usage: runstrat(pargs) without return types