-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monte Carlo pricing engines for all lookbacks #810
Conversation
Renaming Change int to Size Remove unused variables Fix lambda value Fix test failure
Thank you. It seems that part of the code is the same for the four engines. Do you mind if I give a shot at abstracting it out? |
Sure! I initially though of abstracting it out too but wasn't exactly sure how to do that since each engine needs to inherit from a different instrument type. (LookbackFixed, LookbackPartial etc...)It throws a casting error when setupArguments is called on the engine. |
Done. Let me know what you think. Unrelated question: how did you choose which engines to implement? Did you have use for them yourself, or did you pick them at random? (I'm asking because these ones turned out to be quite interesting after all, but we already had analytic engines for these instruments. Unless you need it for some reason, I would rather direct effort towards functionality that doesn't already exist.) |
Thanks for the cleanup, code looks much more concise now! Anyway, the pricing engines I did were selected at random. Initially, I was struggling to find an area where I can contribute since most of the pricing engines for most instrument types under most models were already implemented, which was why I resorted to implementing an alternative pricing engine for already existing instruments, just under a different method. Otherwise, could you suggest any area of the library that could be improved or any other functionality that can add more value to the library? :) |
If you want, you can take a look at a number of issues needing help here on GitHub. I'm afraid they're not categorized, and there's no estimate of the effort required. However, you might still find a few that interest you. |
Implemented 4 Monte Carlo Pricing Engines for 4 different types of lookback options. (Fixed, Floating, Partial Fixed, Partial Floating). Tests have been added to compare against their analytical value to assert that it does not differ by more than 1%.
Also, created new operator method signature for FloatingTypePayoff to take in both price and strike, as the strike is not known until the full path has been generated.