code: def runstrat():
      args = parse_args()
  
      # Create a cerebro entity
      cerebro = bt.Cerebro()
  
      # Add a strategy
      if not args.indicators:
          cerebro.addstrategy(bt.Strategy)
      else:
          cerebro.addstrategy(
              SMAStrategy,
              # args for the strategy
              period=args.period,
              onlydaily=args.onlydaily,
          )
  
      # 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.noresample:
          datapath = args.dataname2 or "../../datas/2006-week-001.txt"
          data2 = btfeeds.BacktraderCSVData(dataname=datapath)
      else:
          if args.oldrs:
              if args.replay:
                  data2 = bt.DataReplayer(
                      dataname=data,
                      timeframe=tframes[args.timeframe],
                      compression=args.compression,
                  )
              else:
                  data2 = bt.DataResampler(
                      dataname=data,
                      timeframe=tframes[args.timeframe],
                      compression=args.compression,
                  )
  
          else:
              data2 = bt.DataClone(dataname=data)
              if args.replay:
                  if args.timeframe == "daily":
                      data2.addfilter(ReplayerDaily)
                  elif args.timeframe == "weekly":
                      data2.addfilter(ReplayerWeekly)
                  elif args.timeframe == "monthly":
                      data2.addfilter(ReplayerMonthly)
              else:
                  if args.timeframe == "daily":
                      data2.addfilter(ResamplerDaily)
                  elif args.timeframe == "weekly":
                      data2.addfilter(ResamplerWeekly)
                  elif args.timeframe == "monthly":
                      data2.addfilter(ResamplerMonthly)
  
      # First add the original data - smaller timeframe
      cerebro.adddata(data)
  
      # And then the large timeframe
      cerebro.adddata(data2)
  
      # Run over everything
      cerebro.run(
          runonce=not args.runnext,
          preload=not args.nopreload,
          oldsync=args.oldsync,
          stdstats=False,
      )
  
      # Plot the result
      if args.plot:
          cerebro.plot(style="bar")
  
file_path: backtrader/samples/data-multitimeframe/data-multitimeframe.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import backtrader
  import backtrader.feeds
  import backtrader.indicators
  from backtrader import ResamplerDaily, ResamplerWeekly, ResamplerMonthly
  from backtrader import ReplayerDaily, ReplayerWeekly, ReplayerMonthly
  from backtrader.utils import flushfile
label_desc: Use image node_id 1 for calling a global function with example usage: runstrat() without return types