code: def runstrat():
      args = parse_args()
  
      # Create a cerebro entity
      cerebro = bt.Cerebro(stdstats=False)
  
      cerebro.addstrategy(
          SMAStrategy,
          # args for the strategy
          period=args.period,
      )
  
      # Load the Data
      datapath = args.dataname or "../../datas//2006-day-001.txt"
      data = btfeeds.BacktraderCSVData(dataname=datapath)
  
      tframes = dict(
          daily=bt.TimeFrame.Days,
          weekly=bt.TimeFrame.Weeks,
          monthly=bt.TimeFrame.Months,
      )
  
      # Handy dictionary for the argument timeframe conversion
      # Resample the data
      if args.oldrp:
          data = bt.DataReplayer(
              dataname=data,
              timeframe=tframes[args.timeframe],
              compression=args.compression,
          )
      else:
          data.replay(
              timeframe=tframes[args.timeframe],
              compression=args.compression,
          )
  
      # First add the original data - smaller timeframe
      cerebro.adddata(data)
  
      # Run over everything
      cerebro.run(preload=False)
  
      # Plot the result
      cerebro.plot(style="bar")
  
file_path: backtrader/samples/data-replay/data-replay.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import backtrader
  import backtrader.feeds
  import backtrader.indicators
label_desc: Use image node_id 1 for calling a global function with example usage: runstrat() without return types