OG-Analytics Standalone example


#1

Can you please give me a totally stand-alone example of using OG-Analytics library? For example, I need to price a vanilla swap, so I need to load 2 curves (forecasting and discounting), specify notional and LIBOR index to use etc. From looking at the examples, I gather that I need to setup security object, then a portfolio object and then a view I guess? The problem is all the examples are somehow intertwined with UI elements for which I have no need, I need a standalone console application.
Thanks so much.


#2

suhasghorp,

You can find an example of the pricing of a swap in the test SwapCalculatorE2ETest. The example uses only the OG-Analytics library. The “E2ETest” means end-to-end tests. They are more tutorials that tests in the strict sense.

The similar example for FRA: ForwardRateAgreementDiscountingMethodE2ETest has also an online documentation with explanation of the different part of the code: https://github.com/OpenGamma/OG-Platform/blob/dev/v2.7.x/docs/og-analytics/worked-out-examples/worked-out-example-fra.rst

The swap example can be found on GitHub at: https://github.com/OpenGamma/OG-Platform/blob/dev/v2.7.x/projects/OG-Analytics/src/test/java/com/opengamma/analytics/financial/interestrate/swap/provider/SwapCalculatorE2ETest.java

The two examples above are from the “2.7” branch, i.e. the stable code from December.

Regards,

Marc