if (retrieveUnderlyingData()) {
if (underlyingData.isOrderCriteriaMet()) {
// Retrieve option contracts for underlying
if (retrieveOptionContracts()) {
// Find the one that is 1) closest strike to underlying last price, 2) expiry not within 15 days
Contract callContract = filterContracts("C");
Contract putContract = filterContracts("P");
if (RequestIDManager.singleton().isOrderIdInitialized()) {
// Place buy straddle for 1 contract as market order
Order callOrder = createOrder("BUY", 1, "MKT");
Order putOrder = createOrder("BUY", 1, "MKT");