@Override
 public double initialGuess(
     LocalDate valuationDate, ObservableValues marketData, ValueType valueType) {
   if (ValueType.ZERO_RATE.equals(valueType)) {
     return marketData.getValue(rateKey);
   }
   return 0d;
 }
예제 #2
0
 public static ObservableValues allQuotes(
     double[] dscOisQuotes,
     String[] dscIdValues,
     double[] fwd3MarketQuotes,
     String[] fwd3IdValue,
     double[] fwd6MarketQuotes,
     String[] fwd6IdValue) {
   /* All quotes for the curve calibration */
   Map<ObservableKey, Double> allQuotes = new HashMap<>();
   for (int i = 0; i < dscOisQuotes.length; i++) {
     allQuotes.put(QuoteKey.of(StandardId.of(SCHEME, dscIdValues[i])), dscOisQuotes[i]);
   }
   for (int i = 0; i < fwd3MarketQuotes.length; i++) {
     allQuotes.put(QuoteKey.of(StandardId.of(SCHEME, fwd3IdValue[i])), fwd3MarketQuotes[i]);
   }
   for (int i = 0; i < fwd6MarketQuotes.length; i++) {
     allQuotes.put(QuoteKey.of(StandardId.of(SCHEME, fwd6IdValue[i])), fwd6MarketQuotes[i]);
   }
   return ObservableValues.of(allQuotes);
 }
 @Override
 public IborFixingDepositTrade trade(LocalDate valuationDate, ObservableValues marketData) {
   double fixedRate = marketData.getValue(rateKey) + spread;
   return template.toTrade(valuationDate, BuySell.BUY, 1d, fixedRate);
 }