Caplin FXIntegrationAPI Documentation - Version 3.47.0-2976-15da410

Message Builder Example - SpotSalesTradeConfirmation

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 SpotSalesTradeConfirmationExample {
    public static void main(String[] args) {
                    		
		TradeConfTypesDef.SpotSalesTradeConfirmation spotSalesTradeConfirmation =
		TradeConfTypesDef.SpotSalesTradeConfirmation
			.newBuilder()
			.setNearSalesLegTradeConfirmation(
			TradeConfPartsDef.SalesLegTradeConfirmationFields
				.newBuilder()
				.setAllInMargin(BigDecimal.valueOf(0.0), true)
				.setAllInMarginEditable()
				.setFwdMargin("", true)
				.setFwdMarginEditable()
				.setTraderAllInRate(BigDecimal.valueOf(1.005390))
				.setTraderFwdPoints(BigDecimal.valueOf(0.005390))
				.build())
			.setSalesCommonFields(
			TradeConfPartsDef.SalesCommonTradeConfirmationFields
				.newBuilder()
				.setCompetition("")
				.setIsAdvised(true)
				.setProfit("1000")
				.setProfitCurrency("USD")
				.setProfitCurrencyDPS("5")
				.setProfitIsHouse("")
				.setProfitRate(BigDecimal.valueOf(1.091790))
				.setReasons("")
				.setSource("")
				.setSpotMargin(BigDecimal.valueOf(0.0), true)
				.setSpotMarginEditable()
				.setTraderRemarks("")
				.setTraderSpotRate(BigDecimal.valueOf(1.09174))
				.build())
			.setSpotTradeConfirmation(
			TradeConfTypesDef.SpotTradeConfirmation
				.newBuilder()
				.setCommonFields(
				TradeConfPartsDef.CommonTradeConfirmationFields
					.newBuilder()
					.setAccount("", true)
					.setAccountEditable()
					.setAssetType("")
					.setCanAllocate(true)
					.setClient("")
					.setCostAmount("12412891.31")
					.setCostCurrency("GBP")
					.setCostCurrencyDPS("2")
					.setCostPercentage("13.56")
					.setCurrencyPair("")
					.setDealtCurrency("", true, true)
					.setDealtCurrencyEditable()
					.setDealtCurrencyRisk()
					.setDigitsBeforePips("2")
					.setEntityDescription("Customer 1")
					.setEntityId("CUSTONE")
					.setExecutionDateTime("20160322123621")
					.setIsAllocated(true)
					.setIsAmendable(true)
					.setIsCancellable(true)
					.setIsReversible(true)
					.setNumberOfPips("2")
					.setOrderID("")
					.setRemarks("")
					.setSpotMidRate(BigDecimal.valueOf(1.08345))
					.setSpotRate(BigDecimal.valueOf(1.08341))
					.setSpotRateDPS(5)
					.setTOBOUser("", true, true)
					.setTOBOUserEditable()
					.setTOBOUserRisk()
					.setTradeDate("20160314")
					.setTradeID("00001561")
					.setTraderUsername("sales_trader@novobank.co.za")
					.setTradingType("")
					.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")
					.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))
					.setCostAmount("12412891.31")
					.setFwdMidPoints(BigDecimal.valueOf(0.005390))
					.setFwdPips("11.98")
					.setFwdPoints("0.001198")
					.setNostroAccountFields(
					SettlementInstructionsPartsDef.NostroAccount
						.newBuilder()
						.setNostroAccount("AE770090004000824676500")
						.setNostroBIC("ARABAEADABC")
						.setNostroName("GBP Nostro Account.")
						.build())
					.setProfit("1000")
					.setRemarks(
					TradeConfPartsDef.RemarksEntry
						.newBuilder()
						.build(), 0)
					.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("")
							.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("")
						.setCanAutoConfirm("")
						.setCanCancel(true)
						.setCanConfirm("")
						.setCanDispute(true)
						.setCanReplace("")
						.setCanUnconfirm("")
						.setConfirmedBy("")
						.setConfirmedDateTime(Instant.now())
						.setIsPayNetted(true)
						.setIsPayNettingRequired("")
						.setIsPaySplit(true)
						.setIsReceiveNetted("")
						.setIsReceiveNettingRequired("")
						.setIsReceiveSplit(true)
						.setNextActionDeadline("2018-03-16T07:25:16+00:00")
						.setNextActionDeadlineDisplayTimezone("America/New_York")
						.setSettlementStatus("")
						.build())
					.setTenor("", true, true)
					.setTenorEditable()
					.setTenorRisk()
					.build())
				.build())
			.build();
            
    }
}