//------------------------------------------------------------------------- public double volatility(CurrencyPair currencyPair, double expiryTime, double strike, double forward) { if (currencyPair.isInverse(this.currencyPair)) { return(smile.volatility(expiryTime, 1d / strike, 1d / forward)); } return(smile.volatility(expiryTime, strike, forward)); }
//------------------------------------------------------------------------- public double volatility(CurrencyPair currencyPair, double expiry, double strike, double forward) { if (currencyPair.isInverse(this.currencyPair)) { return(surface.zValue(expiry, 1d / strike)); } return(surface.zValue(expiry, strike)); }
//------------------------------------------------------------------------- //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @ImmutableValidator private void validate() private void validate() { CurrencyPair pair = observation.Index.CurrencyPair; if (!pair.contains(settlementCurrencyNotional.Currency)) { throw new System.ArgumentException("FxIndex and settlement notional currency are incompatible"); } if (!(pair.Equals(agreedFxRate.Pair) || pair.isInverse(agreedFxRate.Pair))) { throw new System.ArgumentException("FxIndex and agreed FX rate are incompatible"); } }