title: how to use the reqMktData from Ibpy properly?
body: <p>Hi guys am just starting to work on an Ibpy algorithm and i would like to test it with paper trading first but i have a little understanding how to use the reqMktData to get the last price. I have no problem placing orders but this returns nothing for 25 seconds, Im thinking that it is only to be used during trading hours or maybe am just using it wrong any thoughts?</p>
  
  <pre><code>from ib.opt import ibConnection, message
  from ib.ext.Contract import Contract
  from time import sleep
  
  def my_callback_handler(msg):
      inside_mkt_bid = ''
      inside_mkt_ask = ''
  
      if msg.field == 1:
          inside_mkt_bid = msg.price
          print 'bid', inside_mkt_bid
      elif msg.field == 2:
          inside_mkt_ask = msg.price
          print 'ask', inside_mkt_ask
  
  
  tws = ibConnection()
  tws.register(my_callback_handler, message.tickSize, message.tickPrice)
  tws.connect()
  
  c = Contract()
  c.m_symbol = "DATA"
  c.m_secType = "STK"
  c.m_exchange = "SMART"
  c.m_currency = "USD"
  tws.reqMktData(788,c,"",False)
  sleep(25)
  print 'All done'
  
  tws.disconnect()
  </code></pre>