code: def run(self):
      orders = self.alpaca.list_orders(status="open")
      for order in orders:
          self.alpaca.cancel_order(order.id)
  
      # Wait for market to open.
      print("Waiting for market to open...")
      tAMO = threading.Thread(target=self.awaitMarketOpen)
      tAMO.start()
      tAMO.join()
      print("Market opened.")
      while True:
          # Figure out when the market will close so we can prepare to sell beforehand.
          clock = self.alpaca.get_clock()
          closingTime = clock.next_close.replace(
              tzinfo=datetime.timezone.utc
          ).timestamp()
          currTime = clock.timestamp.replace(
              tzinfo=datetime.timezone.utc
          ).timestamp()
          self.timeToClose = closingTime - currTime
  
          if self.timeToClose < (60):
              # Close all positions when 1 minutes til market close.
              print("Market closing soon. Stop trading.")
              break
  
              """# Close all positions when 1 minutes til market close.
              print("Market closing soon.  Closing positions.")
  
              positions = self.alpaca.list_positions()
              for position in positions:
                if(position.side == 'long'):
                  orderSide = 'sell'
                else:
                  orderSide = 'buy'
                qty = abs(int(float(position.qty)))
                respSO = []
                tSubmitOrder = threading.Thread(target=self.submitOrder(qty, position.symbol, orderSide, respSO))
                tSubmitOrder.start()
                tSubmitOrder.join()
  
              # Run script again after market close for next trading day.
              print("Sleeping until market close (15 minutes).")
              time.sleep(60 * 15)"""
  
          else:
              trade = threading.Thread(target=self.trade)
              trade.start()
              trade.join()
              last_equity = float(self.alpaca.get_account().last_equity)
              cur_time = time.time()
              self.equities.append([cur_time, last_equity])
              time.sleep(self.time_interval)
  
imports: from __future__ import annotations
  import datetime
  import threading
  import time
  import alpaca_trade_api
  import gymnasium
  import numpy
  import pandas
  import torch
  from finrl.meta.data_processors.processor_alpaca import AlpacaProcessor
label_desc: Use image node_id 3 for calling the AlpacaPaperTrading obj's underlying member method code with example usage: obj.run() without return types