code: def makeOrders(context, analysis):
      if context.asset in context.portfolio.positions:
          # Current position
          position = context.portfolio.positions[context.asset]
  
          if position == 0:
              log.info("Position Zero")
              return
  
          # Cost Basis
          cost_basis = position.cost_basis
  
          log.info(
              "Holdings: {amount} @ {cost_basis}".format(
                  amount=position.amount, cost_basis=cost_basis
              )
          )
  
          # Sell when holding and got sell singnal
          if isSell(context, analysis):
              profit = (context.price * position.amount) - (
                  cost_basis * position.amount
              )
              order_target_percent(
                  asset=context.asset,
                  target=0,
                  limit_price=context.price
                  * (1 - context.SLIPPAGE_ALLOWED),
              )
              log.info(
                  "Sold {amount} @ {price} Profit: {profit}".format(
                      amount=position.amount,
                      price=context.price,
                      profit=profit,
                  )
              )
          else:
              log.info("no buy or sell opportunity found")
      else:
          # Buy when not holding and got buy signal
          if isBuy(context, analysis):
              order(
                  asset=context.asset,
                  amount=context.ORDER_SIZE,
                  limit_price=context.price
                  * (1 + context.SLIPPAGE_ALLOWED),
              )
              log.info(
                  "Bought {amount} @ {price}".format(
                      amount=context.ORDER_SIZE, price=context.price
                  )
              )
  
imports: import os
  import matplotlib.pyplot
  import numpy
  import pandas
  import talib
  from logbook import Logger
  from matplotlib.dates import date2num
  from mpl_finance import candlestick_ohlc
  from catalyst import run_algorithm
  from catalyst.api import order, order_target_percent, symbol
  from catalyst.exchange.utils.stats_utils import get_pretty_stats
label_desc: Use image node_id 5 for calling a global function with example usage: makeOrders(context, analysis) without return types