Skip to content
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

Merged
merged 4 commits into from
May 9, 2020

Conversation

w31ha0
Copy link
Contributor

@w31ha0 w31ha0 commented May 2, 2020

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.

Renaming

Change int to Size

Remove unused variables

Fix lambda value

Fix test failure
@lballabio
Copy link
Owner

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?

@w31ha0
Copy link
Contributor Author

w31ha0 commented May 7, 2020

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 70.999% when pulling 10827f0 on w31ha0:mc-lookback-engine into 619ebe5 on lballabio:master.

@lballabio lballabio added this to the 1.19 release milestone May 8, 2020
@lballabio
Copy link
Owner

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.)

@w31ha0
Copy link
Contributor Author

w31ha0 commented May 9, 2020

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? :)

@lballabio
Copy link
Owner

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.

@lballabio lballabio merged commit 86869ef into lballabio:master May 9, 2020
@w31ha0 w31ha0 deleted the mc-lookback-engine branch May 27, 2020 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants