code: def runstrat():
      args = parse_args()
  
      # Create a cerebro entity
      cerebro = bt.Cerebro(
          maxcpus=args.maxcpus,
          runonce=not args.no_runonce,
          exactbars=args.exactbars,
          optdatas=not args.no_optdatas,
          optreturn=not args.no_optreturn,
      )
  
      # Add a strategy
      cerebro.optstrategy(
          OptimizeStrategy,
          smaperiod=range(args.ma_low, args.ma_high),
          macdperiod1=range(args.m1_low, args.m1_high),
          macdperiod2=range(args.m2_low, args.m2_high),
          macdperiod3=range(args.m3_low, args.m3_high),
      )
  
      # Get the dates from the args
      fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d")
      todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d")
  
      # Create the 1st data
      data = btfeeds.BacktraderCSVData(
          dataname=args.data, fromdate=fromdate, todate=todate
      )
  
      # Add the Data Feed to Cerebro
      cerebro.adddata(data)
  
      # clock the start of the process
      tstart = time.clock()
  
      # Run over everything
      stratruns = cerebro.run()
  
      # clock the end of the process
      tend = time.clock()
  
      print("==================================================")
      for stratrun in stratruns:
          print("**************************************************")
          for strat in stratrun:
              print(
                  "--------------------------------------------------"
              )
              print(strat.p._getkwargs())
      print("==================================================")
  
      # print out the result
      print("Time used:", str(tend - tstart))
  
file_path: backtrader/samples/optimization/optimization.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import time
  from backtrader.utils.py3 import range
  import backtrader
  import backtrader.indicators
  import backtrader.feeds
label_desc: Use image node_id 1 for calling a global function with example usage: runstrat() without return types