Caplin FXIntegrationAPI Documentation - Version 8.9.0

Message Builder Example - AllocationSalesQuote

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

import java.math.BigInteger;
import static com.caplin.motif.fx.config.DefaultDisplayFields.addDefaultSalesAllocationDetailsUpdateFields;

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

public class AllocationSalesQuoteExample {
    public static void main(String[] args) {
                    		
		QuoteTypesDef.AllocationSalesQuote allocationSalesQuote =
		QuoteTypesDef.AllocationSalesQuote
			.newBuilder()
			.addSalesLegFields(
			QuotePartsDef.SalesLegFields
				.newBuilder()
				.setComponent1(
				QuotePartsDef.SalesSyntheticComponentLegFields
					.newBuilder()
					.setAllInRateDPS("5")
					.setFwdMidPoints(BigDecimal.valueOf(0.005390))
					.setTraderFwdAskPoints(BigDecimal.valueOf(0.001198))
					.setTraderFwdBidPoints(BigDecimal.valueOf(0.001198))
					.build())
				.setComponent2(
				QuotePartsDef.SalesSyntheticComponentLegFields
					.newBuilder()
					.build())
				.setDefaultFwdAskMargin("0.000019")
				.setDefaultFwdBidMargin("0.000019")
				.setTraderAllInAskRate("1.091790")
				.setTraderAllInBidRate("1.091790")
				.setTraderFwdAskPoints("0.001198")
				.setTraderFwdBidPoints("0.001198")
				.build())
			.setAllocationQuote(
			QuoteTypesDef.AllocationQuote
				.newBuilder()
				.addAllocationLegFields(
				QuotePartsDef.AllocationLegFields
					.newBuilder()
					.setAccount("Garfields|GARF")
					.setDisplayFields(addDefaultSalesAllocationDetailsUpdateFields(/* See DefaultDisplayFields javadoc for parameters and available builder methods. */))
					.setEntityDescription("Customer 1")
					.setEntityId("CUSTONE")
					.setFullName("")
					.setIsReprice("")
					.setMarkToMarket("12.45")
					.setTOBOUser("client@customer.co.za")
					.build())
				.addLegFields(
				QuotePartsDef.LegFields
					.newBuilder()
					.setAllInAskRate(BigDecimal.valueOf(1.091790))
					.setAllInBidRate(BigDecimal.valueOf(1.091790))
					.setAllInMidRate(BigDecimal.valueOf(1.091790))
					.setAllInRateDPS(5)
					.setAmount("0")
					.setAskContraCostAmount("")
					.setAskContraCostPercentage(BigDecimal.valueOf(1.5))
					.setAskContraCostRate("")
					.setAskCostAmount(BigDecimal.valueOf(150000.00))
					.setAskCostPercentage(BigDecimal.valueOf(1.5))
					.setAskCostRate("")
					.setBidContraCostAmount("")
					.setBidContraCostPercentage(BigDecimal.valueOf(1.5))
					.setBidContraCostRate(BigDecimal.valueOf(0.0))
					.setBidCostAmount("150000.00")
					.setBidCostPercentage("1.5")
					.setBidCostRate("")
					.setBuySell("")
					.setContraCostAmount("")
					.setContraCostCurrency("GBP")
					.setContraCostPercentage(BigDecimal.valueOf(13.56))
					.setCostCurrency("GBP")
					.setForwardPointsDecimalOffset(0)
					.setFwdAskPips("53.90")
					.setFwdAskPoints("0.005390")
					.setFwdBidPips("53.90")
					.setFwdBidPoints(BigDecimal.valueOf(0.005390))
					.setFwdMidPoints("0.005390")
					.setIsTimeOption("true")
					.setRiskDate("20160314")
					.setRiskTenor("1W")
					.setSettlementDate("")
					.setStartDate("20150620")
					.setStartTenor("1W")
					.setTenor("1M")
					.build())
				.addNdfLegFields(
				QuotePartsDef.NDFLegFields
					.newBuilder()
					.setFixingDate("20150620")
					.build())
				.setAllocationFields(
				QuotePartsDef.AllocationCommonFields
					.newBuilder()
					.setNetBuySell("")
					.setNetDealtAmount(BigDecimal.valueOf(1000000))
					.build())
				.setCommonFields(
				QuotePartsDef.CommonFields
					.newBuilder()
					.setAskContraCostAmount(BigDecimal.valueOf(0.0))
					.setAskContraCostPercentage("1.5")
					.setAskContraCostRate("")
					.setAskCostAmount("150000.00")
					.setAskCostPercentage(BigDecimal.valueOf(1.5))
					.setAskCostRate(BigDecimal.valueOf(0.0))
					.setAskIndicative(true)
					.setAskPips("11.98")
					.setAskQuoteID("")
					.setBidContraCostAmount(BigDecimal.valueOf(0.0))
					.setBidContraCostPercentage("1.5")
					.setBidContraCostRate("")
					.setBidCostAmount("150000.00")
					.setBidCostPercentage("1.5")
					.setBidCostRate(BigDecimal.valueOf(0.0))
					.setBidIndicative("")
					.setBidPips("11.98")
					.setBidQuoteID("")
					.setContraCostAmount("")
					.setContraCostCurrency("GBP")
					.setContraCostPercentage(BigDecimal.valueOf(13.56))
					.setCostCurrency("GBP")
					.setCostCurrencyDPS("2")
					.setCurrencyPair("")
					.setDigitsBeforePips(2)
					.setGFA("1000000")
					.setNumberOfFractionalPips("")
					.setNumberOfPips("2")
					.setOverallTimeOut("")
					.setPriceUpdateSource("")
					.setRemainingTimeOutMillis("")
					.setSpotAskRate("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())
				.build())
			.setSalesCommonFields(
			QuotePartsDef.SalesCommonFields
				.newBuilder()
				.setComponent1(
				QuotePartsDef.SalesSyntheticComponentFields
					.newBuilder()
					.setCurrencyPair("")
					.setDigitsBeforePips("2")
					.setNumberOfPips("2")
					.setSpotMidRate(BigDecimal.valueOf(1.08345))
					.setSpotRateDPS(5)
					.setTraderSpotAskRate(BigDecimal.valueOf(1.08575))
					.setTraderSpotBidRate(BigDecimal.valueOf(1.08575))
					.build())
				.setComponent2(
				QuotePartsDef.SalesSyntheticComponentFields
					.newBuilder()
					.build())
				.setDefaultSpotAskMargin(BigDecimal.valueOf(0.00054))
				.setDefaultSpotBidMargin(BigDecimal.valueOf(0.00054))
				.setProfitAskRate("1.090098")
				.setProfitBidRate(BigDecimal.valueOf(1.091790))
				.setProfitCurrency("USD")
				.setProfitCurrencyDPS("5")
				.setProfitIsHouse("")
				.setReasons("")
				.setSyntheticCrossCurrency("GBP")
				.setTraderSpotAskRate("1.08575")
				.setTraderSpotBidRate(BigDecimal.valueOf(1.08575))
				.build())
			.build();
            
    }
}