Caplin FXIntegrationAPI Documentation - Version 6.0.0

Message Builder Example - ForwardTradeConfirmation

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 ForwardTradeConfirmationExample {
    public static void main(String[] args) {
                    		
		TradeConfTypesDef.ForwardTradeConfirmation forwardTradeConfirmation =
		TradeConfTypesDef.ForwardTradeConfirmation
			.newBuilder()
			.setCommonFields(
			TradeConfPartsDef.CommonTradeConfirmationFields
				.newBuilder()
				.setAccount("", true)
				.setAccountEditable()
				.setAllocationSettlementDateOptions("ORIGINAL,EARLIER,LATER")
				.setAssetType("")
				.setBackOfficeID("")
				.setCanAllocate("")
				.setClient("")
				.setClientAgreementDateTime(Instant.now())
				.setClientAgreementDateTimeEditable()
				.setContraCostAmount("")
				.setContraCostCurrency("")
				.setContraCostPercentage(BigDecimal.valueOf(1.5))
				.setCostAmount(BigDecimal.valueOf(12412891.31))
				.setCostCurrency("GBP")
				.setCostCurrencyDPS(2)
				.setCostPercentage(BigDecimal.valueOf(13.56))
				.setCurrencyPair("")
				.setDealtCurrency("GBP")
				.setDealtCurrencyEditable()
				.setDealtCurrencyRisk()
				.setDeliverableType("")
				.setDigitsBeforePips("2")
				.setDisplayFields(addDefaultSalesAllocationDetailsUpdateFields(/* See DefaultDisplayFields javadoc for parameters and available builder methods. */))
				.setEntityDescription("Customer 1")
				.setEntityId("CUSTONE")
				.setExecutionDateTime("20160322123621")
				.setForceReporting(true)
				.setFullName("")
				.setIsAllocated("")
				.setIsAmendable(true)
				.setIsCancellable("")
				.setIsReversible("")
				.setNumberOfPips(2)
				.setOrderID("")
				.setOriginalTradeID("")
				.setPostTradeType("")
				.setPriceSource("st1@caplin.com")
				.setPurpose("Commercial")
				.setRemarks("")
				.setSpotMidRate("1.08345")
				.setSpotRate(BigDecimal.valueOf(1.08341))
				.setSpotRateDPS("5")
				.setTOBOUser("", true, true)
				.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(Instant.now())
					.setRemarkSource("")
					.build())
				.setAccount("Garfields|GARF")
				.setAdjustedSwapPoints("")
				.setAllInMidRate(BigDecimal.valueOf(1.091790))
				.setAllInRate("1.091790")
				.setAllInRateDPS("5")
				.setAllocatableAmount(BigDecimal.valueOf(500))
				.setAmount("", true, true)
				.setAmountEditable()
				.setAmountRisk()
				.setBuySell("")
				.setContraAmount("350")
				.setContraCostAmount(BigDecimal.valueOf(0.0))
				.setContraCostCurrency("")
				.setContraCostPercentage(BigDecimal.valueOf(1.5))
				.setCostAmount(BigDecimal.valueOf(12412891.31))
				.setCostCurrency("GBP")
				.setCostPercentage(BigDecimal.valueOf(13.56))
				.setEntityDescription("Customer 1")
				.setEntityId("CUSTONE")
				.setFilledAmount(BigDecimal.valueOf(0))
				.setForwardPointsDecimalOffset(0)
				.setFullName("")
				.setFwdMidPoints("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(BigDecimal.valueOf(0.0))
				.setProfit(BigDecimal.valueOf(1000))
				.setRemainingAmount("500")
				.setRiskDate("20160314")
				.setRiskTenor("1W")
				.setSettlementDate("")
				.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(Instant.now())
					.setCanAdHoc("")
					.setCanAffirm(true)
					.setCanAutoConfirm(true)
					.setCanCancel(true)
					.setCanConfirm("")
					.setCanDispute(true)
					.setCanReplace("")
					.setCanUnconfirm("")
					.setConfirmedBy("")
					.setConfirmedDateTime(Instant.now())
					.setIsPayNetted("")
					.setIsPayNettingRequired(true)
					.setIsPaySplit(true)
					.setIsReceiveNetted(true)
					.setIsReceiveNettingRequired(true)
					.setIsReceiveSplit(true)
					.setNextActionDeadline(Instant.now())
					.setNextActionDeadlineDisplayTimezone("America/New_York")
					.setSettlementStatus("")
					.build())
				.setStartDate("", true)
				.setStartDateRisk()
				.setStartTenor("", true)
				.setStartTenorRisk()
				.setTOBOUser("", true, true)
				.setTOBOUserEditable()
				.setTOBOUserRisk()
				.setTenor("", true, true)
				.setTenorEditable()
				.setTenorRisk()
				.build())
			.setNdfLegTradeConfirmation(
			TradeConfPartsDef.NDFLegTradeConfirmationFields
				.newBuilder()
				.setFixingAmount("")
				.setFixingCode("[CCY]1/1600/GBLO")
				.setFixingCurrency("USD")
				.setFixingDate("20150620")
				.setFixingDescription("WMR [CCY] 4pm London")
				.setReferenceAmount(BigDecimal.valueOf(0.0))
				.setReferenceCurrency(BigDecimal.valueOf(0.0))
				.setSettlementAmount("")
				.build())
			.setNdfTradeConfirmation(
			TradeConfPartsDef.NDFTradeConfirmationFields
				.newBuilder()
				.setFixingSource("WMR 8am London Time")
				.setSettlementCurrency("GBP")
				.build())
			.setTimeOptionLegTradeConfirmation(
			TradeConfPartsDef.TimeOptionLegTradeConfirmationFields
				.newBuilder()
				.setFilledAmount("0")
				.setRemainingAmount("500")
				.setRiskDate("20160314")
				.setRiskTenor("1W")
				.setStartDate("", true)
				.setStartDateRisk()
				.setStartTenor("1W")
				.setStartTenorRisk()
				.build())
			.build();
            
    }
}