Running FX option example


#1

Dear community,

I have been trying to create an example of FX options
Can anyone explain how to get the aforementioned test unit running link ?

Kind regards and thanks in advance,
Jeroen


FX Volitility Surface example
#2

The unit test you link to runs fine in Eclipse and IntelliJ. See obtaining Strata for more details.


#5

Dear @stephen,

Thank you for the quick reply.
I am currently set up in Eclipse and can run the standard examples
I was able to replicate the FX option from the test suite and create an example out of it.
There are still some things bugging me however,

  1. As I understand , theResolvedFxSingle will ensure that the currency pair we wish to trade is converted to market conventions.
    For example If I wish to buy 10 euros in exchange for 15 dollars in the future this will be converted to an inverse EURUSD trade since the market convention is to quote EUR as the base currency.
    An example of this appears in the test case
    `final CurrencyAmount EUR_AMOUNT = CurrencyAmount.of(EUR, NOTIONAL);

    final CurrencyAmount USD_AMOUNT = CurrencyAmount.of(USD, -NOTIONAL * STRIKE_RATE_HIGH);
    final ResolvedFxSingle fx = ResolvedFxSingle.of(EUR_AMOUNT, USD_AMOUNT, PAYMENT_DATE);`

Since we pay USD( amount is negative) and receive EUR this should be converted to a market conform pay EUR receive USD quote.
My intuition would therefore be to create an FXoption with the longShort argument set to SHORT. However, in the example it is set to LONG.
final ResolvedFxVanillaOption CALL_ITM = ResolvedFxVanillaOption.builder() .longShort(LONG)
Furthermore we use the US discountfactor to get the present expected value of the option . But since the USD amount is negative, if we enter into the currency conversion, do we not receive EUR and should therefore use the EUR discountfactor?

Best regards,
Jeroen


#6

The classes starting with “Resolved” are a low-level form structured for processing by the pricer. As a general rule, you should create and use the non-resolved classes like FxVanillaOption. That way, you can enter your trades as best makes sense to you, and let Strata change them to the resolved form as necessary.

See also the bottom of this page.

The present value of an FX option is expressed in the counter currency, see the Javadoc.