code: def next(self):
      if self.orefs:
          return  # pending orders do nothing
  
      if not self.position:
          if self.cross > 0.0:  # crossing up
              p1 = self.data.close[0] * (1.0 - self.p.limit)
              p2 = self.data.close[0] * (1.0 - 2 * 2 * self.p.limit)
              p3 = self.data.close[0] * (1.0 - 3 * 3 * self.p.limit)
  
              valid1 = datetime.timedelta(self.p.limdays)
              valid2 = valid3 = datetime.timedelta(self.p.limdays2)
  
              if self.p.switchp1p2:
                  p1, p2 = p2, p1
                  valid1, valid2 = valid2, valid1
  
              print("valid1 is:", valid1)
  
              kargs = dict(exectype=bt.Order.Limit)
              kargs[("target" * self.p.usetarget) or "size"] = 1
  
              o1 = self._dobuy(price=p1, valid=valid1, **kargs)
              print(
                  "{}: Oref {} / Buy at {}".format(
                      self.datetime.date(), o1.ref, p1
                  )
              )
  
              oco2 = o1 if self.p.do_oco else None
              o2 = self._dobuy(
                  price=p2, valid=valid2, oco=oco2, **kargs
              )
  
              print(
                  "{}: Oref {} / Buy at {}".format(
                      self.datetime.date(), o2.ref, p2
                  )
              )
  
              if self.p.do_oco:
                  oco3 = o1 if not self.p.oco1oco2 else oco2
              else:
                  oco3 = None
  
              o3 = self._dobuy(
                  price=p3, valid=valid3, oco=oco3, **kargs
              )
  
              print(
                  "{}: Oref {} / Buy at {}".format(
                      self.datetime.date(), o3.ref, p3
                  )
              )
  
              self.orefs = [o1.ref, o2.ref, o3.ref]
  
      else:  # in the market
          if (len(self) - self.holdstart) >= self.p.hold:
              self._doclose()
  
file_path: backtrader/samples/oco/oco.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import backtrader
label_desc: Use image node_id 3 for calling the St obj's underlying member method code with example usage: obj.next() without return types