class_docstr: This strategy is capable of:
  
    - Going Long with a Moving Average upwards CrossOver
  
    - Going Long again with a MACD upwards CrossOver
  
    - Closing the aforementioned longs with the corresponding downwards
      crossovers
class_docstr_tok: ["This","strategy","is","capable","of",":","-","Going","Long","with","a","Moving","Average","upwards","CrossOver","-","Going","Long","again","with","a","MACD","upwards","CrossOver","-","Closing","the","aforementioned","longs","with","the","corresponding","downwards","crossovers"]
code: def __init__(self):
      # Choose data to buy from
      self.dtarget = self.getdatabyname(self.p.dtarget)
  
      # Create indicators
      sma1 = bt.ind.SMA(self.dtarget, period=self.p.sma1)
      sma2 = bt.ind.SMA(self.dtarget, period=self.p.sma2)
      self.smasig = bt.ind.CrossOver(sma1, sma2)
  
      macd = bt.ind.MACD(
          self.dtarget,
          period_me1=self.p.macd1,
          period_me2=self.p.macd2,
          period_signal=self.p.macdsig,
      )
  
      # Cross of macd.macd and macd.signal
      self.macdsig = bt.ind.CrossOver(macd.macd, macd.signal)
  
file_path: backtrader/samples/multi-copy/multi-copy.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import random
  import backtrader
label_desc: Use image node_id 2 to create a new TheStrategy object from inherited base classes: bt with example: obj = TheStrategy()