private static void optionsOperations(EClientSocket client) { //! [reqsecdefoptparams] client.reqSecDefOptParams(0, "IBM", "", "STK", 8314); //! [reqsecdefoptparams] /*** Calculating implied volatility ***/ //! [calculateimpliedvolatility] client.calculateImpliedVolatility(5001, ContractSamples.OptionAtBOX(), 5, 85, null); //! [calculateimpliedvolatility] /*** Canceling implied volatility ***/ client.cancelCalculateImpliedVolatility(5001); /*** Calculating option's price ***/ //! [calculateoptionprice] client.calculateOptionPrice(5002, ContractSamples.OptionAtBOX(), 0.22, 85, null); //! [calculateoptionprice] /*** Canceling option's price calculation ***/ client.cancelCalculateOptionPrice(5002); /*** Exercising options ***/ //! [exercise_options] client.exerciseOptions(5003, ContractSamples.OptionWithTradingClass(), 1, 1, null, 1); //! [exercise_options] }