code: def __init__(self):
      # SimpleMovingAverage on main data
      # Equivalent to -> sma = btind.SMA(self.data, period=self.p.smaperiod)
      sma = btind.SMA(period=self.p.smaperiod)
  
      # CrossOver (1: up, -1: down) close / sma
      self.buysell = btind.CrossOver(self.data.close, sma, plot=True)
  
      # Sentinel to None: new ordersa allowed
      self.order = None
  
file_path: backtrader/samples/observers/observers-orderobserver.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import datetime
  import backtrader
  import backtrader.feeds
  import backtrader.indicators
  from orderobserver import OrderObserver
label_desc: Use image node_id 3 to create a new MyStrategy object from inherited base classes: bt with example: obj = MyStrategy()