title: Place order with API IB
body: <p>After deciding to walk away from Ibpy and learn the API IB I am having trouble even placing an order. What am I doing wrong? </p>
  
  <pre class="lang-py prettyprint-override"><code>from ibapi.client import EClient
  from ibapi.wrapper import EWrapper
  from ibapi.contract import Contract
  from ibapi.order import *
  
  
  
  
  #Def Market Order
  
  class TestApp(EClient, EWrapper):
      def __init__(self):
          EClient.__init__(self, self)
  
      def nextValidId(self, orderId:int):
          self.nextOrderId = orderId
          print(orderId)
          self.start()
  
  
      def start(self):
  
          contract = Contract()
          contract.symbol = "ES"
          contract.secType = "FUT"
          contract.exchange = "GLOBEX"
          contract.currency = "USD"
          contract.lastTradeDateOrContractMonth = "201903"
  
  
          order = Order()
          order.action = "BUY"
          order.orderType = "MKT"
          order.totalQuantity = 1
          order.outsideRth = True
  
          self.placeOrder(self.nextOrderId, contract, order)
  
      def stop(self):
          self.done = True
          self.disconnect()
  
  def main():
      app=TestApp()
      app.connect("127.0.0.1", 7496,420)
      app.nextOrderId = 0
      app.run()
  
  
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>removed more Ibpy and replaced with ibapi</p>
  
  <p>now getting</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>%Run basic.py
        394
        ERROR -1 2104 Market data farm connection is OK:usfuture
        ERROR -1 2104 Market data farm connection is OK:usfarm
        ERROR -1 2106 HMDS data farm connection is OK:ushmds
        ERROR 394 200 No security definition has been found for the request</p>
      </blockquote>
    </blockquote>
  </blockquote>