Caplin FXIntegrationAPI Documentation - Version 8.6.0

Message Builder Example - TicketForwardTradeConfirmation

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

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

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 TicketForwardTradeConfirmationExample {
    public static void main(String[] args) {
                    		
		TradeConfTypesDef.TicketForwardTradeConfirmation ticketForwardTradeConfirmation =
		TradeConfTypesDef.TicketForwardTradeConfirmation
			.newBuilder()
			.setCommonForwardTradeConfirmation(
			TradeConfTypesDef.CommonForwardTradeConfirmation
				.newBuilder()
				.setCommonFields(
				TradeConfPartsDef.CommonTradeConfirmationFields
					.newBuilder()
					.setAccount("Garfields|GARF")
					.setAccountEditable()
					.setAllocationSettlementDateOptions("ORIGINAL,EARLIER,LATER")
					.setAmountDPS("2")
					.setAssetType("")
					.setBackOfficeID("")
					.setCanAllocate("")
					.setCanDrawdown("")
					.setClient("")
					.setClientAgreementDateTime(Instant.now())
					.setClientAgreementDateTimeEditable()
					.setContraAmountDPS("2")
					.setContraCostAmount("")
					.setContraCostCurrency("GBP")
					.setContraCostCurrencyDPS("2")
					.setContraCostPercentage(BigDecimal.valueOf(13.56))
					.setCostAmount("12412891.31")
					.setCostCurrency("GBP")
					.setCostCurrencyDPS(2)
					.setCostPercentage(BigDecimal.valueOf(13.56))
					.setCurrencyPair("")
					.setDealtCurrency("", true, true)
					.setDealtCurrencyEditable()
					.setDealtCurrencyRisk()
					.setDeliverableType("")
					.setDigitsBeforePips(2)
					.setEntityDescription("Customer 1")
					.setEntityId("CUSTONE")
					.setExecutionDateTime("20160322123621")
					.setFullName("")
					.setIsAllocated("")
					.setIsAmendable("")
					.setIsCancellable(true)
					.setIsReversible(true)
					.setNumberOfPips("2")
					.setOrderID("")
					.setOriginalTradeID("")
					.setPostTradeType("")
					.setPriceSource("st1@caplin.com")
					.setPurpose("Commercial")
					.setRemarks("")
					.setServiceContraCostCurrencyDPS(2)
					.setServiceCostCurrencyDPS("2")
					.setSpotMidRate(BigDecimal.valueOf(1.08345))
					.setSpotRate(BigDecimal.valueOf(1.08341))
					.setSpotRateDPS("5")
					.setStatus("AWAITING-PRICE")
					.setTOBOUser("client@customer.co.za")
					.setTOBOUserEditable()
					.setTOBOUserRisk()
					.setTags(Arrays.asList(/* ... */))
					.setTradeDate("20160314")
					.setTradeID("00001561")
					.setTraderUsername("sales_trader@novobank.co.za")
					.setTradingType("")
					.setUTI("")
					.setVenue("FX Sales")
					.setWarningCode("001")
					.setWarningMessage("You do not have sufficient credit for EUR")
					.build())
				.setLegTradeConfirmation(
				TradeConfPartsDef.LegTradeConfirmationFields
					.newBuilder()
					.addRemarks(
					TradeConfPartsDef.RemarksEntry
						.newBuilder()
						.setRemarkDateTime("2018-03-16T07:25:16+00:00")
						.setRemarkOriginStatus("")
						.setRemarkSource("")
						.setRemarkTargetStatus("")
						.build())
					.setAccount("Garfields|GARF")
					.setAdjustedSwapPoints("")
					.setAllInMidRate(BigDecimal.valueOf(1.091790))
					.setAllInRate("1.091790")
					.setAllInRateDPS(5)
					.setAllocatableAmount("500")
					.setAllocatableContraAmount("500")
					.setAmount(BigDecimal.valueOf(0))
					.setAmountEditable()
					.setAmountRisk()
					.setBuySell("")
					.setContraAmount("500")
					.setContraCostAmount("")
					.setContraCostCurrency("GBP")
					.setContraCostPercentage(BigDecimal.valueOf(13.56))
					.setCostAmount(BigDecimal.valueOf(12412891.31))
					.setCostCurrency("GBP")
					.setCostPercentage(BigDecimal.valueOf(13.56))
					.setEntityDescription("Customer 1")
					.setEntityId("CUSTONE")
					.setFilledAmount("0")
					.setForwardPointsDecimalOffset(0)
					.setFullName("")
					.setFwdMidPoints(BigDecimal.valueOf(0.005390))
					.setFwdPips("11.98")
					.setFwdPoints(BigDecimal.valueOf(0.001198))
					.setIsTimeOption("true")
					.setNostroAccountFields(
					SettlementInstructionsPartsDef.NostroAccount
						.newBuilder()
						.setNostroAccount("AE770090004000824676500")
						.setNostroBIC("ARABAEADABC")
						.setNostroName("GBP Nostro Account.")
						.build())
					.setOriginalRate("")
					.setProfit("1000")
					.setRemainingAmount(BigDecimal.valueOf(500))
					.setRemarks(
					TradeConfPartsDef.RemarksEntry
						.newBuilder()
						.build(), 0)
					.setRiskDate("20160314")
					.setRiskTenor("1W")
					.setServiceContraCostAmount("")
					.setServiceContraCostCurrency("GBP")
					.setServiceCostAmount(BigDecimal.valueOf(0.0))
					.setServiceCostCurrency("GBP")
					.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(true)
							.setNettingStatus("NETTED")
							.setSettlementAmount(BigDecimal.valueOf(0.0))
							.setSettlementCurrency("GBP")
							.setSettlementDetailsLine1("")
							.setSettlementDetailsLine2("")
							.setSettlementDetailsLine3("")
							.setSettlementDetailsLine4("")
							.setSettlementDetailsLine5("")
							.setSettlementDetailsLine6("")
							.setSettlementDirection("")
							.setSettlementDisplayName("[CCY] Account 1")
							.setSettlementId("")
							.setSettlementInstructionType("EXISTING")
							.setSettlementStatus("")
							.setSplitComponentId("")
							.build())
						.addPayNettingComponents(
						SettlementInstructionsPartsDef.NettingComponents
							.newBuilder()
							.setAmount(BigDecimal.valueOf(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("")
						.setCanApproveInstructions(true)
						.setCanAutoConfirm("")
						.setCanCancel("")
						.setCanConfirm("")
						.setCanDispute("")
						.setCanRejectInstructions("")
						.setCanRelease(true)
						.setCanReplace(true)
						.setCanUnconfirm("")
						.setConfirmedBy("")
						.setConfirmedDateTime("2018-03-16T07:25:16+00:00")
						.setIsPayNetted(true)
						.setIsPayNettingRequired("")
						.setIsPaySplit(true)
						.setIsReceiveNetted("")
						.setIsReceiveNettingRequired("")
						.setIsReceiveSplit("")
						.setNextActionDeadline(Instant.now())
						.setNextActionDeadlineDisplayTimezone("America/New_York")
						.setSettlementStatus("")
						.build())
					.setStartDate("20150620")
					.setStartDateRisk()
					.setStartTenor("", true)
					.setStartTenorRisk()
					.setTOBOUser("client@customer.co.za")
					.setTOBOUserEditable()
					.setTOBOUserRisk()
					.setTenor("", true, true)
					.setTenorEditable()
					.setTenorRisk()
					.setTradeID("00001561")
					.build())
				.setNdfLegTradeConfirmation(
				TradeConfPartsDef.NDFLegTradeConfirmationFields
					.newBuilder()
					.setFixingAmount("")
					.setFixingCode("[CCY]1/1600/GBLO")
					.setFixingCurrency("USD")
					.setFixingDate("20150620")
					.setFixingDescription("WMR [CCY] 4pm London")
					.setReferenceAmount("")
					.setReferenceCurrency("")
					.setSettlementAmount(BigDecimal.valueOf(0.0))
					.build())
				.setNdfTradeConfirmation(
				TradeConfPartsDef.NDFTradeConfirmationFields
					.newBuilder()
					.setFixingSource("WMR 8am London Time")
					.setSettlementCurrency("GBP")
					.build())
				.setTimeOptionLegTradeConfirmation(
				TradeConfPartsDef.TimeOptionLegTradeConfirmationFields
					.newBuilder()
					.setFilledAmount(BigDecimal.valueOf(0))
					.setRemainingAmount(BigDecimal.valueOf(500))
					.setRiskDate("20160314")
					.setRiskTenor("1W")
					.setStartDate("20150620")
					.setStartDateRisk()
					.setStartTenor("1W")
					.setStartTenorRisk()
					.build())
				.build())
			.setDisplayFields(addDefaultSalesAllocationDetailsUpdateFields(/* See DefaultDisplayFields javadoc for parameters and available builder methods. */))
			.setSettlementTradeFields(
			SettlementInstructionsPartsDef.SettlementSummaryTradeFields
				.newBuilder()
				.build())
			.build();
            
    }
}