Re: Binomial American Options with Discrete Dividends & Greeks
there's no binomial engine for that, but you can use the FDDividendAmericanEngine and DividendVanillaOption classes; see test-suite/dividendoption.cpp for an example. Due to the way the numerical calculation is performed, the engine doesn't provide all the Greeks natively; only delta and gamma. For the others, you'll have to bump the inputs and reprice the option.
The lines from 694 to 725 initialize the option and its market data. Those from 741 to 757 calculates the value and the greeks, and compares the available greeks with those calculated by bumping the data (e.g., to calculate the delta modify thevalue of the underlying, recalculate, and see how much the value has changed; the same approach can be used for all the other greeks). For an American option, you'll need to specify an American exercise: see line 827.
Re: 答复: Binomial American Options with Discrete Dividends & Greeks
I don't think QL.NET provides intraday pricing (given that QuantLib itself only did in the latest release, and as an optional feature) so setting the time back one hour won't work. One thing you can try: if you have the price, delta and gamma (that is, P, dP/du and d^2P/du^2) you might plug them in the Black-Scholes equation and get dP/dt (i.e., the theta).