Caplin FXIntegrationAPI Documentation - Version 3.47.0-2976-15da410

Message Builder Example - SalesSwapQuote

package com.caplin.examples.fxapi.generated.motif.fx.rates.QuoteTypesDef; 

import java.math.BigInteger;

import com.caplin.generated.motif.fx.rates.QuotePartsDef;
import com.caplin.generated.motif.fx.rates.QuoteTypesDef;

public class SalesSwapQuoteExample {
    public static void main(String[] args) {
                    		
		QuoteTypesDef.SalesSwapQuote salesSwapQuote =
		QuoteTypesDef.SalesSwapQuote
			.newBuilder()
			.setFarSalesLegFields(
			QuotePartsDef.SalesLegFields
				.newBuilder()
				.setDefaultFwdAskMargin(BigDecimal.valueOf(0.000019))
				.setDefaultFwdBidMargin("0.000019")
				.setTraderAllInAskRate("1.091790")
				.setTraderAllInBidRate("1.091790")
				.setTraderFwdAskPoints(BigDecimal.valueOf(0.001198))
				.setTraderFwdBidPoints(BigDecimal.valueOf(0.001198))
				.build())
			.setNearSalesLegFields(
			QuotePartsDef.SalesLegFields
				.newBuilder()
				.build())
			.setSalesCommonFields(
			QuotePartsDef.SalesCommonFields
				.newBuilder()
				.setDefaultSpotAskMargin("0.00054")
				.setDefaultSpotBidMargin("0.00054")
				.setProfitAskRate(BigDecimal.valueOf(1.090098))
				.setProfitBidRate("1.091790")
				.setProfitCurrency("USD")
				.setProfitCurrencyDPS(5)
				.setProfitIsHouse("")
				.setTraderSpotAskRate(BigDecimal.valueOf(1.08575))
				.setTraderSpotBidRate("1.08575")
				.build())
			.setSalesSwapFields(
			QuotePartsDef.SalesSwapQuoteFields
				.newBuilder()
				.setDefaultSwapAskMargin(BigDecimal.valueOf(0.000040))
				.setDefaultSwapBidMargin(BigDecimal.valueOf(0.000040))
				.setTraderSwapAskPoints(BigDecimal.valueOf(0.004894))
				.setTraderSwapBidPoints(BigDecimal.valueOf(0.004211))
				.build())
			.setSwapQuote(
			QuoteTypesDef.SwapQuote
				.newBuilder()
				.setCommonFields(
				QuotePartsDef.CommonFields
					.newBuilder()
					.setAskCostAmount(BigDecimal.valueOf(150000.00))
					.setAskCostPercentage("1.5")
					.setAskCostRate("")
					.setAskIndicative("")
					.setAskPips("11.98")
					.setAskQuoteID("")
					.setBidCostAmount("150000.00")
					.setBidCostPercentage("1.5")
					.setBidCostRate(BigDecimal.valueOf(0.0))
					.setBidIndicative(true)
					.setBidPips("11.98")
					.setBidQuoteID("")
					.setCostCurrency("GBP")
					.setCostCurrencyDPS("2")
					.setCurrencyPair("")
					.setDigitsBeforePips(2)
					.setGFA("1000000")
					.setNumberOfFractionalPips("")
					.setNumberOfPips("2")
					.setOverallTimeOut(0)
					.setPriceUpdateSource("")
					.setRemainingTimeOutMillis(0)
					.setSpotAskRate(BigDecimal.valueOf(1.08349))
					.setSpotBidRate("1.08341")
					.setSpotMidRate(BigDecimal.valueOf(1.08345))
					.setSpotRateDPS(5)
					.setSwapGFA("1 000 000")
					.setTimePriceReceived("")
					.setWarningCode("001")
					.setWarningMessage("You do not have sufficient credit for EUR")
					.build())
				.setFarLegFields(
				QuotePartsDef.LegFields
					.newBuilder()
					.setAllInAskRate("1.091790")
					.setAllInBidRate(BigDecimal.valueOf(1.091790))
					.setAllInMidRate(BigDecimal.valueOf(1.091790))
					.setAllInRateDPS(5)
					.setAmount("0")
					.setBuySell("")
					.setFwdAskPips("53.90")
					.setFwdAskPoints(BigDecimal.valueOf(0.005390))
					.setFwdBidPips("53.90")
					.setFwdBidPoints("0.005390")
					.setFwdMidPoints(BigDecimal.valueOf(0.005390))
					.setRiskDate("20160314")
					.setRiskTenor("1W")
					.setSettlementDate("")
					.setTenor("1M")
					.build())
				.setNearLegFields(
				QuotePartsDef.LegFields
					.newBuilder()
					.build())
				.setSwapFields(
				QuotePartsDef.SwapQuoteFields
					.newBuilder()
					.setSwapAskPips("49.34")
					.setSwapAskPoints(BigDecimal.valueOf(0.004934))
					.setSwapBidPips("41.71")
					.setSwapBidPoints("0.004171")
					.setSwapMidPoints(BigDecimal.valueOf(0.004553))
					.build())
				.build())
			.build();
            
    }
}