Yes, I have found something about bracket orders below.
One follow up question: when either the take profit and stop loss order is filled, is it necessary for the program to cancel the other side? (e.g. when take profit happen, is it necessary to cancel the order of stop loss? Or will the system handle it automatically?)
This is the information I found in the document:
"4. Placing bracket order
// create instance of trading interface
ibc = GetTradingInterface(“IB”);
parentID = ibc.PlaceOrder(“MSFT”, “BUY”, 1000, “LMT”, 27, 0, “GTC”, False );
ibc.PlaceOrder(“MSFT”, “SELL”, 1000, “LMT”, 28, 0, “GTC”, False, 100, “”, parentID );
ibc.PlaceOrder(“MSFT”, “SELL”, 1000, “STP”, 26, 26, “GTC”, True, 100, “”, parentID );
Note that TRANSMIT flag is set to FALSE on all bracket orders except the last one. This ensures that orders wait until bracket order set is completed. Setting Transmit flag to TRUE on the very last one transmits entire bracket."