<div id="locationField">
<input id="autocomplete" placeholder="Enter your address"
onFocus="geolocate()" type="text"></input>
</div>
给出错误
european_option = VanillaOption(payoff, exercise)
spot_handle = SimpleQuote(spot_price)
flat_ts = FlatForward(calculation_date, risk_free_rate, day_count)
dividend_yield = FlatForward(calculation_date, dividend_rate, day_count)
flat_vol_ts = BlackConstantVol(calculation_date, cal, volatility, day_count)
bsm_process = BlackScholesMertonProcess(spot_handle,
dividend_yield,
flat_ts,
flat_vol_ts)
european_option.setPricingEngine(AnalyticEuropeanEngine(bsm_process))
我需要什么导入?
答案 0 :(得分:2)
您无需额外导入。错误的原因是pyql开发人员已经导出了一些具有不同名称的QuantLib,以便遵循PEP 8并在Python中更加惯用。正确的电话是
european_option.set_pricing_engine(AnalyticEuropeanEngine(bsm_process))
从this pyql example可以看到。