code: def initialize(context):
      log.info("initializing arbitrage algorithm")
  
      # The context contains a new "exchanges" attribute which is a dictionary
      # of exchange objects by exchange name. This allow easy access to the
      # exchanges.
      context.buying_exchange = context.exchanges["poloniex"]
      context.selling_exchange = context.exchanges["bitfinex"]
  
      context.trading_pair_symbol = "eth_btc"
      context.trading_pairs = dict()
  
      # Note the second parameter of the symbol() method
      # Passing the exchange name here returns a TradingPair object including
      # the exchange information. This allow all other operations using
      # the TradingPair to target the correct exchange.
      context.trading_pairs[context.buying_exchange] = symbol(
          "eth_btc", context.buying_exchange.name
      )
  
      context.trading_pairs[context.selling_exchange] = symbol(
          context.trading_pair_symbol, context.selling_exchange.name
      )
  
      context.entry_points = [
          dict(gap=0.03, amount=0.05),
          dict(gap=0.04, amount=0.1),
          dict(gap=0.05, amount=0.5),
      ]
      context.exit_points = [
          dict(gap=-0.02, amount=0.5),
      ]
  
      context.SLIPPAGE_ALLOWED = 0.02
      pass
  
file_path: catalyst/catalyst/examples/arbitrage_with_interface.py
imports: from logbook import Logger
  from catalyst.api import record, order, symbol
  from catalyst.exchange.utils.stats_utils import get_pretty_stats
  from catalyst.utils.run_algo import run_algorithm
label_desc: Use image node_id 1 for calling a global function with example usage: initialize(context) without return types