class_docstr: Broker implementation for Interactive Brokers.
  
  This class maps the orders/positions from Interactive Brokers to the
  internal API of ``backtrader``.
  
  Notes:
  
    - ``tradeid`` is not really supported, because the profit and loss are
      taken directly from IB. Because (as expected) calculates it in FIFO
      manner, the pnl is not accurate for the tradeid.
  
    - Position
  
      If there is an open position for an asset at the beginning of
      operaitons or orders given by other means change a position, the trades
      calculated in the ``Strategy`` in cerebro will not reflect the reality.
  
      To avoid this, this broker would have to do its own position
      management which would also allow tradeid with multiple ids (profit and
      loss would also be calculated locally), but could be considered to be
      defeating the purpose of working with a live broker
class_docstr_tok: ["Broker","implementation","for","Interactive","Brokers",".","This","class","maps","the","orders\/positions","from","Interactive","Brokers","to","the","internal","API","of","``","backtrader","``",".","Notes",":","-","``","tradeid","``","is","not","really","supported",",","because","the","profit","and","loss","are","taken","directly","from","IB",".","Because","(","as","expected",")","calculates","it","in","FIFO","manner",",","the","pnl","is","not","accurate","for","the","tradeid",".","-","Position","If","there","is","an","open","position","for","an","asset","at","the","beginning","of","operaitons","or","orders","given","by","other","means","change","a","position",",","the","trades","calculated","in","the","``","Strategy","``","in","cerebro","will","not","reflect","the","reality",".","To","avoid","this",",","this","broker","would","have","to","do","its","own","position","management","which","would","also","allow","tradeid","with","multiple","ids","(","profit","and","loss","would","also","be","calculated","locally",")",",","but","could","be","considered","to","be","defeating","the","purpose","of","working","with","a","live","broker"]
code: def getcommissioninfo(self, data):
      contract = data.tradecontract
      try:
          mult = float(contract.m_multiplier)
      except (ValueError, TypeError):
          mult = 1.0
  
      stocklike = contract.m_secType not in (
          "FUT",
          "OPT",
          "FOP",
      )
  
      return IBCommInfo(mult=mult, stocklike=stocklike)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import collections
  from copy import copy
  from datetime import date, datetime, timedelta
  import threading
  import uuid
  import ib.ext.Order
  import ib.opt
  from backtrader.feed import DataBase
  from backtrader import TimeFrame, num2date, date2num, BrokerBase, Order, OrderBase, OrderData
  from backtrader.utils.py3 import bytes, bstr, with_metaclass, queue, MAXFLOAT
  from backtrader.metabase import MetaParams
  from backtrader.comminfo import CommInfoBase
  from backtrader.position import Position
  from backtrader.stores import ibstore
  from backtrader.utils import AutoDict, AutoOrderedDict
  from backtrader.comminfo import CommInfoBase
label_desc: Use image node_id 10 for calling the IBBroker obj's underlying member method code with example usage: obj.getcommissioninfo(data) and returns: IBCommInfo