code: def disconnect(self):
          
          if self.ibConn is not None:
              self.log.info("[DISCONNECT FROM IB]")
              self.ibConn.disconnect()
              self._disconnected_by_user = True
docs: Disconnect from TWS/IBGW