コード例 #1
0
        //-------------------------------------------------------------------------
        public FxSwapTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double nearFxRate, double farLegForwardPoints)
        {
            Optional <LocalDate> tradeDate = tradeInfo.TradeDate;

            if (tradeDate.Present)
            {
                ArgChecker.inOrderOrEqual(tradeDate.get(), startDate, "tradeDate", "startDate");
            }
            double amount1 = BuySell.BUY.normalize(notional);

            return(FxSwapTrade.builder().info(tradeInfo).product(FxSwap.ofForwardPoints(CurrencyAmount.of(currencyPair.Base, amount1), FxRate.of(currencyPair, nearFxRate), farLegForwardPoints, startDate, endDate, BusinessDayAdjustment)).build());
        }
コード例 #2
0
        // create an FX Swap trade
        private static Trade createTrade3()
        {
            FxSwap swap = FxSwap.ofForwardPoints(CurrencyAmount.of(GBP, 10000), FxRate.of(GBP, USD, 1.62), 0.03, LocalDate.of(2014, 6, 14), LocalDate.of(2014, 9, 14));

            return(FxSwapTrade.builder().product(swap).info(TradeInfo.builder().id(StandardId.of("example", "3")).addAttribute(AttributeType.DESCRIPTION, "GBP 10,000/USD @ 1.62 swap").counterparty(StandardId.of("example", "BigBankA")).settlementDate(LocalDate.of(2014, 9, 15)).build()).build());
        }