code: def next(self):
      if self.order:
          # An order is pending ... nothing can be done
          return
  
      # Check if we are in the market
      if self.position:
          # In the maerket - check if it's the time to sell
          if self.buysell < 0:
              self.log("SELL CREATE, %.2f" % self.data.close[0])
              self.sell()
  
      elif self.buysell > 0:
          if self.p.valid:
              valid = self.data.datetime.date(0) + datetime.timedelta(
                  days=self.p.valid
              )
          else:
              valid = None
  
          # Not in the market and signal to buy
          if self.p.exectype == "Market":
              self.buy(exectype=bt.Order.Market)  # default if not given
  
              self.log(
                  "BUY CREATE, exectype Market, price %.2f"
                  % self.data.close[0]
              )
  
          elif self.p.exectype == "Close":
              self.buy(exectype=bt.Order.Close)
  
              self.log(
                  "BUY CREATE, exectype Close, price %.2f"
                  % self.data.close[0]
              )
  
          elif self.p.exectype == "Limit":
              price = self.data.close * (1.0 - self.p.perc1 / 100.0)
  
              self.buy(
                  exectype=bt.Order.Limit, price=price, valid=valid
              )
  
              if self.p.valid:
                  txt = "BUY CREATE, exectype Limit, price %.2f, valid: %s"
                  self.log(txt % (price, valid.strftime("%Y-%m-%d")))
              else:
                  txt = "BUY CREATE, exectype Limit, price %.2f"
                  self.log(txt % price)
  
          elif self.p.exectype == "Stop":
              price = self.data.close * (1.0 + self.p.perc1 / 100.0)
  
              self.buy(exectype=bt.Order.Stop, price=price, valid=valid)
  
              if self.p.valid:
                  txt = (
                      "BUY CREATE, exectype Stop, price %.2f, valid: %s"
                  )
                  self.log(txt % (price, valid.strftime("%Y-%m-%d")))
              else:
                  txt = "BUY CREATE, exectype Stop, price %.2f"
                  self.log(txt % price)
  
          elif self.p.exectype == "StopLimit":
              price = self.data.close * (1.0 + self.p.perc1 / 100.0)
  
              plimit = self.data.close * (1.0 + self.p.perc2 / 100.0)
  
              self.buy(
                  exectype=bt.Order.StopLimit,
                  price=price,
                  valid=valid,
                  plimit=plimit,
              )
  
              if self.p.valid:
                  txt = (
                      "BUY CREATE, exectype StopLimit, price %.2f,"
                      " valid: %s, pricelimit: %.2f"
                  )
                  self.log(
                      txt % (price, valid.strftime("%Y-%m-%d"), plimit)
                  )
              else:
                  txt = (
                      "BUY CREATE, exectype StopLimit, price %.2f,"
                      " pricelimit: %.2f"
                  )
                  self.log(txt % (price, plimit))
  
file_path: backtrader/samples/order-execution/order-execution.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import argparse
  import datetime
  import os.path
  import time
  import sys
  import backtrader
  import backtrader.feeds
  import backtrader.indicators
label_desc: Use image node_id 4 for calling the OrderExecutionStrategy obj's underlying member method code with example usage: obj.next() without return types