title: couldn't get interactive broker historical data
body: <p>I am working on IB Gateway and want to get the historical data.
  As i have completed the steps on IB Gateway software to enable the API.</p>
  
  <p>I am using python notebook for this.
  For now i am running this code and i am able to import the given library but rest of the code giving me this error. Important thing is connection is established as I have mention client id 1. then it is created and can be seen on IB Gateway application.</p>
  
  <p>My code is here.</p>
  
  <pre><code>from ib_insync import *
  #util.startLoop() # uncomment this line when in a notebook
  
  ib = IB()
  ib.connect('127.0.0.1', 5021, clientId=1)
  
  bars = ib.reqHistoricalData(
         contract=Stock('TSLA', 'SMART', 'USD'),
         endDateTime='',
         durationStr='30 D',
         barSizeSetting='1 hour',
         whatToShow='TRADES',
         useRTH=True)
  
  print(bars)
  </code></pre>
  
  <p>Here is the error.</p>
  
  <pre><code>Peer closed connection
  clientId 1 already in use?
  API connection failed: CancelledError()
  </code></pre>
  
  <p>As i am using notebook if i uncomment the second line (util.startLoop()) <code>it adds one more error about timeout..</code></p>
  
  <p>Need help to get this done.</p>
  
  <p>Big Thanks</p>