code: def _handle_data_rsi_only(context, data):
      price = data.current(context.asset, "close")
      log.info("got price {price}".format(price=price))
  
      if price is np.nan:
          log.warn("no pricing data")
          return
  
      if context.base_price is None:
          context.base_price = price
  
      try:
          prices = data.history(
              context.asset,
              fields="price",
              bar_count=20,
              frequency="30T",
          )
      except Exception as e:
          log.warn("historical data not available: ".format(e))
          return
  
      rsi = talib.RSI(prices.values, timeperiod=16)[-1]
      log.info("got rsi {}".format(rsi))
  
      signal = None
      if rsi < context.RSI_OVERSOLD:
          signal = "long"
  
      # Making sure that the price is still current
      price = data.current(context.asset, "close")
      cash = context.portfolio.cash
      log.info(
          "quote currency available: {cash}, cap: {cap}".format(
              cash=cash, cap=context.MAX_HOLDINGS
          )
      )
      volume = data.current(context.asset, "volume")
      price_change = (price - context.base_price) / context.base_price
      record(
          price=price,
          price_change=price_change,
          rsi=rsi,
          volume=volume,
          cash=cash,
          starting_cash=context.portfolio.starting_cash,
          leverage=context.account.leverage,
      )
  
      _handle_buy_sell_decision(context, data, signal, price)
  
file_path: catalyst/catalyst/examples/rsi_profit_target.py
imports: from datetime import timedelta
  import pandas
  import numpy
  import talib
  from logbook import Logger
  from catalyst.api import order, symbol, record, get_open_orders
  from catalyst.utils.run_algo import run_algorithm
label_desc: Use image node_id 3 for calling a global function with example usage: _handle_data_rsi_only(context, data) without return types