Caplin FXIntegrationAPI Documentation - Version 3.56.0

Message Builder Example - SalesBlockQuote

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 SalesBlockQuoteExample {
    public static void main(String[] args) {
                    		
		QuoteTypesDef.SalesBlockQuote salesBlockQuote =
		QuoteTypesDef.SalesBlockQuote
			.newBuilder()
			.addNdfLegFields(
			QuotePartsDef.NDFLegFields
				.newBuilder()
				.setFixingDate("20150620")
				.build())
			.addSalesLegFields(
			QuotePartsDef.SalesLegFields
				.newBuilder()
				.setDefaultFwdAskMargin(BigDecimal.valueOf(0.000019))
				.setDefaultFwdBidMargin("0.000019")
				.setTraderAllInAskRate("1.091790")
				.setTraderAllInBidRate(BigDecimal.valueOf(1.091790))
				.setTraderFwdAskPoints(BigDecimal.valueOf(0.001198))
				.setTraderFwdBidPoints(BigDecimal.valueOf(0.001198))
				.build())
			.setBlockQuote(
			QuoteTypesDef.BlockQuote
				.newBuilder()
				.addLegFields(
				QuotePartsDef.LegFields
					.newBuilder()
					.setAllInAskRate("1.091790")
					.setAllInBidRate(BigDecimal.valueOf(1.091790))
					.setAllInMidRate("1.091790")
					.setAllInRateDPS("5")
					.setAmount(BigDecimal.valueOf(0))
					.setAskContraCostAmount("")
					.setAskContraCostPercentage(BigDecimal.valueOf(1.5))
					.setAskContraCostRate(BigDecimal.valueOf(0.0))
					.setAskCostAmount("150000.00")
					.setAskCostPercentage("1.5")
					.setAskCostRate(BigDecimal.valueOf(0.0))
					.setBidContraCostAmount("")
					.setBidContraCostPercentage("1.5")
					.setBidContraCostRate(BigDecimal.valueOf(0.0))
					.setBidCostAmount(BigDecimal.valueOf(150000.00))
					.setBidCostPercentage(BigDecimal.valueOf(1.5))
					.setBidCostRate(BigDecimal.valueOf(0.0))
					.setBuySell("")
					.setContraCostAmount("")
					.setContraCostCurrency("")
					.setContraCostPercentage(BigDecimal.valueOf(1.5))
					.setCostCurrency("GBP")
					.setFwdAskPips("53.90")
					.setFwdAskPoints("0.005390")
					.setFwdBidPips("53.90")
					.setFwdBidPoints("0.005390")
					.setFwdMidPoints("0.005390")
					.setRiskDate("20160314")
					.setRiskTenor("1W")
					.setSettlementDate("")
					.setTenor("1M")
					.build())
				.addNdfLegFields(
				QuotePartsDef.NDFLegFields
					.newBuilder()
					.build())
				.setBlockFields(
				QuotePartsDef.BlockCommonFields
					.newBuilder()
					.setNetBuySell("")
					.setNetDealtAmount("1000000")
					.build())
				.setCommonFields(
				QuotePartsDef.CommonFields
					.newBuilder()
					.setAskContraCostAmount("")
					.setAskContraCostPercentage(BigDecimal.valueOf(1.5))
					.setAskContraCostRate(BigDecimal.valueOf(0.0))
					.setAskCostAmount("150000.00")
					.setAskCostPercentage("1.5")
					.setAskCostRate(BigDecimal.valueOf(0.0))
					.setAskIndicative(true)
					.setAskPips("11.98")
					.setAskQuoteID("")
					.setBidContraCostAmount("")
					.setBidContraCostPercentage("1.5")
					.setBidContraCostRate("")
					.setBidCostAmount(BigDecimal.valueOf(150000.00))
					.setBidCostPercentage(BigDecimal.valueOf(1.5))
					.setBidCostRate("")
					.setBidIndicative("")
					.setBidPips("11.98")
					.setBidQuoteID("")
					.setContraCostAmount("")
					.setContraCostCurrency("")
					.setContraCostPercentage("1.5")
					.setCostCurrency("GBP")
					.setCostCurrencyDPS("2")
					.setCurrencyPair("")
					.setDigitsBeforePips("2")
					.setGFA("1000000")
					.setNumberOfFractionalPips("")
					.setNumberOfPips("2")
					.setOverallTimeOut("")
					.setPriceUpdateSource("")
					.setRemainingTimeOutMillis("")
					.setSpotAskRate("1.08349")
					.setSpotBidRate("1.08341")
					.setSpotMidRate("1.08345")
					.setSpotRateDPS("5")
					.setSwapGFA("1 000 000")
					.setTimePriceReceived("")
					.setWarningCode("001")
					.setWarningMessage("You do not have sufficient credit for EUR")
					.build())
				.build())
			.setSalesCommonFields(
			QuotePartsDef.SalesCommonFields
				.newBuilder()
				.setDefaultSpotAskMargin(BigDecimal.valueOf(0.00054))
				.setDefaultSpotBidMargin(BigDecimal.valueOf(0.00054))
				.setProfitAskRate(BigDecimal.valueOf(1.090098))
				.setProfitBidRate(BigDecimal.valueOf(1.091790))
				.setProfitCurrency("USD")
				.setProfitCurrencyDPS(5)
				.setProfitIsHouse("")
				.setTraderSpotAskRate(BigDecimal.valueOf(1.08575))
				.setTraderSpotBidRate(BigDecimal.valueOf(1.08575))
				.build())
			.build();
            
    }
}