code: def runstrat():
      args = parse_args()
  
      # Create a cerebro entity
      cerebro = bt.Cerebro(stdstats=False)
  
      # Add a strategy
      cerebro.addstrategy(bt.Strategy)
  
      # Get the dates from the args
      fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d")
      todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d")
  
      data = btfeeds.YahooFinanceData(
          dataname=args.data, fromdate=fromdate, todate=todate
      )
  
      # Add the resample data instead of the original
      cerebro.adddata(data)
  
      # Add a simple moving average if requirested
      cerebro.addindicator(btind.SMA, period=args.period)
  
      # Add a writer with CSV
      if args.writer:
          cerebro.addwriter(bt.WriterFile, csv=args.wrcsv)
  
      # Run over everything
      cerebro.run()
  
      # Plot if requested
      if args.plot:
          cerebro.plot(style="bar", numfigs=args.numfigs, volume=False)
  
file_path: backtrader/samples/yahoo-test/yahoo-test.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import backtrader
  import backtrader.indicators
  import backtrader.feeds
  import backtrader.filters
label_desc: Use image node_id 1 for calling a global function with example usage: runstrat() without return types