Caplin FXIntegrationAPI Documentation - Version 3.56.0

Message Builder Example - BlockSalesTradeConfirmation

package com.caplin.examples.fxapi.generated.motif.fx.tradeconfirmation.TradeConfTypesDef; 

import java.math.BigInteger;

import com.caplin.generated.motif.fx.settlementinstructions.SettlementInstructionsPartsDef;
import com.caplin.generated.motif.fx.tradeconfirmation.TradeConfPartsDef;
import com.caplin.generated.motif.fx.tradeconfirmation.TradeConfTypesDef;

public class BlockSalesTradeConfirmationExample {
    public static void main(String[] args) {
                    		
		TradeConfTypesDef.BlockSalesTradeConfirmation blockSalesTradeConfirmation =
		TradeConfTypesDef.BlockSalesTradeConfirmation
			.newBuilder()
			.addSalesNettedLegConfirmationFields(
			TradeConfTypesDef.NettedLegSalesTradeConfirmationFields
				.newBuilder()
				.addSalesInputLegTradeConfirmation(
				TradeConfPartsDef.SalesLegTradeConfirmationFields
					.newBuilder()
					.setAllInMargin(BigDecimal.valueOf(0.0), true)
					.setAllInMarginEditable()
					.setFwdMargin("", true)
					.setFwdMarginEditable()
					.setTraderAllInRate("1.005390")
					.setTraderFwdPoints(BigDecimal.valueOf(0.005390))
					.build())
				.setSalesNettedLegTradeConfirmation(
				TradeConfPartsDef.SalesLegTradeConfirmationFields
					.newBuilder()
					.build())
				.build())
			.setBlockTradeConfirmation(
			TradeConfTypesDef.BlockTradeConfirmation
				.newBuilder()
				.addNettedLegTradeConfirmationFields(
				TradeConfTypesDef.NettedLegTradeConfirmationFields
					.newBuilder()
					.addInputLegSwapPartnerTradeConfirmation(
					TradeConfPartsDef.SwapPartnerLegTradeConfirmationFields
						.newBuilder()
						.setSwapPartnerInputLegID(0)
						.setSwapPartnerNettedLegID(0)
						.build())
					.addInputLegTradeConfirmation(
					TradeConfPartsDef.LegTradeConfirmationFields
						.newBuilder()
						.addRemarks(
						TradeConfPartsDef.RemarksEntry
							.newBuilder()
							.setRemarkDateTime("2018-03-16T07:25:16+00:00")
							.setRemarkSource("")
							.build())
						.setAccount("Garfields|GARF")
						.setAllInMidRate(BigDecimal.valueOf(1.091790))
						.setAllInRate(BigDecimal.valueOf(1.091790))
						.setAllInRateDPS(5)
						.setAmount(BigDecimal.valueOf(0.0), true, true)
						.setAmountEditable()
						.setAmountRisk()
						.setBuySell("")
						.setContraAmount(BigDecimal.valueOf(350))
						.setContraCostAmount("")
						.setContraCostCurrency(BigDecimal.valueOf(0.0))
						.setContraCostPercentage(BigDecimal.valueOf(1.5))
						.setCostAmount(BigDecimal.valueOf(12412891.31))
						.setCostCurrency("GBP")
						.setCostPercentage("13.56")
						.setFwdMidPoints("0.005390")
						.setFwdPips("11.98")
						.setFwdPoints(BigDecimal.valueOf(0.001198))
						.setNostroAccountFields(
						SettlementInstructionsPartsDef.NostroAccount
							.newBuilder()
							.setNostroAccount("AE770090004000824676500")
							.setNostroBIC("ARABAEADABC")
							.setNostroName("GBP Nostro Account.")
							.build())
						.setProfit(BigDecimal.valueOf(1000))
						.setSettlementDate("", true, true)
						.setSettlementDateEditable()
						.setSettlementDateRisk()
						.setSettlementTradeFields(
						SettlementInstructionsPartsDef.SettlementTradeFields
							.newBuilder()
							.addPay(
							SettlementInstructionsPartsDef.SettlementFields
								.newBuilder()
								.setBankAccount("12345678")
								.setBankAddress1("12 Capitol")
								.setBankAddress2("The City")
								.setBankAddress3("London")
								.setBankName("Bank Of Caplin")
								.setBankSwift("CAP123")
								.setIndividualAccount("87654321")
								.setIndividualAddress1("98 Lane")
								.setIndividualAddress2("Manchester")
								.setIndividualName("Susan Sellers")
								.setIndividualSwift("SOLD987")
								.setIsDefaultSettlementInstruction("")
								.setNettingStatus("NETTED")
								.setSettlementAmount("")
								.setSettlementCurrency("GBP")
								.setSettlementDetailsLine1("")
								.setSettlementDetailsLine2("")
								.setSettlementDetailsLine3("")
								.setSettlementDetailsLine4("")
								.setSettlementDirection("")
								.setSettlementDisplayName("[CCY] Account 1")
								.setSettlementId("")
								.setSettlementInstructionType("EXISTING")
								.setSettlementStatus("")
								.setSplitComponentId("")
								.build())
							.addPayNettingComponents(
							SettlementInstructionsPartsDef.NettingComponents
								.newBuilder()
								.setAmount("0")
								.setBuySell("")
								.setTradeID("00001561")
								.build())
							.addReceive(
							SettlementInstructionsPartsDef.SettlementFields
								.newBuilder()
								.build())
							.addReceiveNettingComponents(
							SettlementInstructionsPartsDef.NettingComponents
								.newBuilder()
								.build())
							.setAffirmedBy("")
							.setAffirmedDateTime("2018-03-16T07:25:16+00:00")
							.setCanAdHoc(true)
							.setCanAffirm("")
							.setCanAutoConfirm(true)
							.setCanCancel(true)
							.setCanConfirm(true)
							.setCanDispute(true)
							.setCanReplace("")
							.setCanUnconfirm(true)
							.setConfirmedBy("")
							.setConfirmedDateTime(Instant.now())
							.setIsPayNetted("")
							.setIsPayNettingRequired(true)
							.setIsPaySplit(true)
							.setIsReceiveNetted(true)
							.setIsReceiveNettingRequired("")
							.setIsReceiveSplit(true)
							.setNextActionDeadline(Instant.now())
							.setNextActionDeadlineDisplayTimezone("America/New_York")
							.setSettlementStatus("")
							.build())
						.setTenor("", true, true)
						.setTenorEditable()
						.setTenorRisk()
						.build())
					.addInputNDFLegTradeConfirmation(
					TradeConfPartsDef.NDFLegTradeConfirmationFields
						.newBuilder()
						.setFixingAmount(BigDecimal.valueOf(0.0))
						.setFixingCode("[CCY]1/1600/GBLO")
						.setFixingCurrency("USD")
						.setFixingDate("20150620")
						.setFixingDescription("WMR [CCY] 4pm London")
						.setReferenceAmount(BigDecimal.valueOf(0.0))
						.setReferenceCurrency("")
						.setSettlementAmount("")
						.setSettlementCurrency("GBP")
						.build())
					.setNdfNettedLegTradeConfirmation(
					TradeConfPartsDef.NDFLegTradeConfirmationFields
						.newBuilder()
						.build())
					.setNettedLegTradeConfirmation(
					TradeConfPartsDef.LegTradeConfirmationFields
						.newBuilder()
						.build())
					.build())
				.setBlockFields(
				TradeConfPartsDef.BlockTradeConfirmationFields
					.newBuilder()
					.setNetBuySell("")
					.setNetContraAmount(BigDecimal.valueOf(1123400))
					.setNetDealtAmount(BigDecimal.valueOf(1000000))
					.build())
				.setCommonFields(
				TradeConfPartsDef.CommonTradeConfirmationFields
					.newBuilder()
					.setAccount("", true)
					.setAccountEditable()
					.setAssetType("")
					.setCanAllocate(true)
					.setClient("")
					.setContraCostAmount(BigDecimal.valueOf(0.0))
					.setContraCostCurrency("")
					.setContraCostPercentage(BigDecimal.valueOf(1.5))
					.setCostAmount(BigDecimal.valueOf(12412891.31))
					.setCostCurrency("GBP")
					.setCostCurrencyDPS(2)
					.setCostPercentage("13.56")
					.setCurrencyPair("")
					.setDealtCurrency("", true, true)
					.setDealtCurrencyEditable()
					.setDealtCurrencyRisk()
					.setDigitsBeforePips(2)
					.setEntityDescription("Customer 1")
					.setEntityId("CUSTONE")
					.setExecutionDateTime("20160322123621")
					.setForceReporting(true)
					.setIsAllocated(true)
					.setIsAmendable(true)
					.setIsCancellable(true)
					.setIsReversible(true)
					.setNumberOfPips("2")
					.setOrderID("")
					.setSpotMidRate(BigDecimal.valueOf(1.08345))
					.setSpotRate("1.08341")
					.setSpotRateDPS(5)
					.setStreamingMode("MANUAL, STREAMING")
					.setTOBOUser("", true, true)
					.setTOBOUserEditable()
					.setTOBOUserRisk()
					.setTradeDate("20160314")
					.setTradeID("00001561")
					.setTraderSpotAskRate(BigDecimal.valueOf(1.08575))
					.setTraderSpotBidRate("1.08575")
					.setTraderUsername("sales_trader@novobank.co.za")
					.setTradingType("")
					.setWarningCode("001")
					.setWarningMessage("You do not have sufficient credit for EUR")
					.build())
				.setNettedAmount(BigDecimal.valueOf(0.0))
				.build())
			.setSalesCommonTradeConfirmationFields(
			TradeConfPartsDef.SalesCommonTradeConfirmationFields
				.newBuilder()
				.setCompetition(true)
				.setIsAdvised("")
				.setProfit(BigDecimal.valueOf(1000))
				.setProfitCurrency("USD")
				.setProfitCurrencyDPS(5)
				.setProfitIsHouse(true)
				.setProfitRate("1.091790")
				.setReasons("")
				.setSource("")
				.setSpotMargin("", true)
				.setSpotMarginEditable()
				.setTraderRemarks("")
				.setTraderSpotRate("1.09174")
				.build())
			.build();
            
    }
}