How to Determine a Futures Contract

Example 1 - Standard Method of Determining a Futures Contract

void onHowtoDetermineFuture(){

       

       Contract contract = new Contract();

       Order order = new Order();

       

       contract.m_symbol = "ES";

       contract.m_secType = "FUT";

       contract.m_expiry = "201109";

       contract.m_exchange = "GLOBEX";

       contract.m_currency = "USD";

       

       order.m_action = "BUY";

       order.m_totalQuantity = 1;

       order.m_orderType = "LMT";

       order.m_lmtPrice = enteredLmtPrice;

       

       m_client.placeOrder(GlobalOrderId, contract, order);

}

 

Example 2 - Determining a Futures Contract Using the Local Symbol

void inUsingLocalSymbolForFuture(){

       

       Contract contract = new Contract();

       Order order = new Order();

       

       contract.m_localSymbol = "ESU1";

       contract.m_secType = "FUT";

       contract.m_exchange = "GLOBEX";

       contract.m_currency = "USD";

       

       order.m_action = "BUY";

       order.m_totalQuantity = 1;

       order.m_orderType = "LMT";

       order.m_lmtPrice = enteredLmtPrice;

       

       m_client.placeOrder(GlobalOrderId, contract, order);       

}