//------------------------------------------------------------------------- public virtual void coverage() { FxSingleBarrierOption test1 = FxSingleBarrierOption.of(VANILLA_OPTION, BARRIER, REBATE); FxSingleBarrierOption test2 = FxSingleBarrierOption.of(FxVanillaOption.builder().longShort(SHORT).expiryDate(EXPIRY_DATE).expiryTime(EXPIRY_TIME).expiryZone(EXPIRY_ZONE).underlying(FX).build(), SimpleConstantContinuousBarrier.of(BarrierType.UP, KnockType.KNOCK_IN, 1.5)); coverImmutableBean(test1); coverBeanEquals(test1, test2); }
//------------------------------------------------------------------------- internal static FxVanillaOption sut() { return(FxVanillaOption.builder().longShort(LONG).expiryDate(EXPIRY_DATE).expiryTime(EXPIRY_TIME).expiryZone(EXPIRY_ZONE).underlying(FX).build()); }
public virtual void test_builder_earlyPaymentDate() { assertThrowsIllegalArg(() => FxVanillaOption.builder().longShort(LONG).expiryDate(LocalDate.of(2015, 2, 21)).expiryTime(EXPIRY_TIME).expiryZone(EXPIRY_ZONE).underlying(FX).build()); }
internal static FxVanillaOption sut2() { FxSingle fxProduct = FxSingle.of(CurrencyAmount.of(EUR, -NOTIONAL), CurrencyAmount.of(GBP, NOTIONAL * 0.9), PAYMENT_DATE); return(FxVanillaOption.builder().longShort(LongShort.SHORT).expiryDate(LocalDate.of(2015, 2, 15)).expiryTime(LocalTime.of(12, 45)).expiryZone(ZoneId.of("GMT")).underlying(fxProduct).build()); }