SierpinskyJanitor,I'm working on coding pricing models for a risk system. We trade a lot of options here so I've been delving into option pricing models even though I'm not really a quant. I've been using Black-Scholes during my development, but I've hit a wall concerning dividends. Up to this point, I've been using QLNet for my option pricing. I'm calling its continuous-dividend binomial model fine (Cox-Ross-Rubenstein). It's the discrete-dividend models that I can't get to work.As a dividend date for a stock is approaching, I've found that the dividend yield returned from the Bloomberg API for that stock gets much too high. The stocks in the portfolio don't pay a 14% dividend yield for instance, regardless of what Bloomberg calculates. As a result, my analytics get out of whack when dividend dates are approaching and when I am using a continuous-dividend option pricing model.I then tried to use the QuantLib+SWIG solutions mentioned here,
http://stackoverflow.com/questions/3334 ... or-c-sharp, specifically the binaries provided by Resolver Systems (mentioned in the comments). From here, I ran into a different problem: I was able to get prices for options using a discrete-dividend model, but the model doesn't support fractional days. Our theta decay is, of course, always changing, so we'd like to look at it intraday. Going back to the QLNet code, it was a simple task to modify the Actual365Fixed.cs code to have it support fractional days. This brought me back to my first problem: QLNet doesn't support discrete dividend option pricing.At this point, I have to choose between discrete dividends and fractional days. (I chose discrete dividends)I tried to build my own QuantLib+SWIG binaries to see if I could make changes to my copy of QuantLib and get them working in C#, but I have been running into problems doing that. I get a PInvoke error when I try to run the sample projects in the QuantLib+SWIG solution (
http://sourceforge.net/projects/quantli ... p/download ). This error was mentioned in the QuantLib mailing list here
http://thread.gmane.org/gmane.comp.fina ... .user/8238 . Many thanks to Luigi Ballabio for point it out to me
http://stackoverflow.com/questions/9824 ... nexception . I attempted the solution mentioned in the mailing list, but I couldn't get that to work. I was still getting the same error.For the time being, I'll be using the QuantLib+SWIG binaries provided by Resolver Systems. My models won't be able to handle intraday time changes however.