code: def runstrat():
      args = parse_args()
  
      cerebro = bt.Cerebro()
      cerebro.broker.set_cash(args.cash)
      cerebro.broker.set_eosbar(True)
  
      dkwargs = dict()
      if args.fromdate:
          fromdate = datetime.datetime.strptime(
              args.fromdate, "%Y-%m-%d"
          )
          dkwargs["fromdate"] = fromdate
  
      if args.todate:
          todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d")
          dkwargs["todate"] = todate
  
      if args.no_replay:
          data = bt.feeds.YahooFinanceCSVData(
              dataname=args.data,
              timeframe=bt.TimeFrame.Days,
              compression=1,
              **dkwargs,
          )
          data.addfilter(DayStepsCloseFilter)
          cerebro.adddata(data)
      else:
          data = bt.feeds.YahooFinanceCSVData(
              dataname=args.data,
              timeframe=bt.TimeFrame.Minutes,
              compression=1,
              **dkwargs,
          )
          data.addfilter(DayStepsReplayFilter)
          cerebro.replaydata(
              data, timeframe=bt.TimeFrame.Days, compression=1
          )
  
      cerebro.addstrategy(
          St,
          sellafter=args.sellafter,
          highperiod=args.highperiod,
          market=args.market,
      )
  
      cerebro.run(
          runonce=False, preload=False, oldbuysell=args.oldbuysell
      )
      if args.plot:
          pkwargs = dict(style="bar")
          if args.plot is not True:  # evals to True but is not True
              npkwargs = eval(
                  "dict(" + args.plot + ")"
              )  # args were passed
              pkwargs.update(npkwargs)
  
          cerebro.plot(**pkwargs)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import backtrader
  import backtrader.indicators
label_desc: Use image node_id 1 for calling a global function with example usage: runstrat() without return types