Contract symbols for trading E-mini futures via TWS API

Discussion in 'Automated Trading' started by Duncan Krebs, Nov 27, 2015.

  1. Hey,
    I'm trying to trade futures for the first time vis TWS Java API and have a question related to figuring out what the symbol should when submitting an order via the API for futures. Specifically The ES Mini Future Dec 15, common sense is telling me it should be 'ESZ15' with the prefix of the future followed by the month code and year but the order is getting rejected.

    Can anyone help out? - Duncan
     
  2. You have to build a contract object in which the code will be "ES" and you specify the expiry date in a different field.

    Which language are you using? This works in python:
    Code:
      
      ibcontract = Contract()
      ibcontract.secType = "FUT"
      ibcontract.expiry="201512"
     
      ibcontract.symbol='ES'
      ibcontract.exchange='GLOBEX'
    GAT