@synchronized(mlock)
    def calculateOptionPrice(self, reqId, contract, volatility, underPrice):
        if not self.m_connected:
            self.error(EClientErrors.NO_VALID_ID, EClientErrors.NOT_CONNECTED, "")
            return
        if self.m_serverVersion < self.MIN_SERVER_VER_REQ_CALC_OPTION_PRICE:
            self.error(reqId, EClientErrors.UPDATE_TWS, "  It does not support calculate option price requests.")
            return
        VERSION = 1
        try:
            #  send calculate option price msg
            self.send(self.REQ_CALC_OPTION_PRICE)
            self.send(VERSION)
            self.send(reqId)
            #  send contract fields
            self.send(contract.m_conId)
            self.send(contract.m_symbol)
            self.send(contract.m_secType)
            self.send(contract.m_expiry)
            self.send(contract.m_strike)
            self.send(contract.m_right)
            self.send(contract.m_multiplier)
            self.send(contract.m_exchange)
            self.send(contract.m_primaryExch)
            self.send(contract.m_currency)
            self.send(contract.m_localSymbol)
            self.send(volatility)
            self.send(underPrice)
        except Exception as e:
            self.error(reqId, EClientErrors.FAIL_SEND_REQCALCOPTIONPRICE, str(e))
            self.close()
See `TreeBuilder`.
dataset/ETHPy150Open CarterBain/Medici/ib/ext/EClientSocket.py/EClientSocket.calculateOptionPrice--crossover with--dataset/ETHPy150Open mtlevolio/pylinkchecker/pylinkchecker/bs4/builder/_html5lib.py/HTML5TreeBuilder.test_fragment_to_document