Caplin FXIntegrationAPI Documentation - Version 3.50.0-3047-f42bfe4

Message Builder Example - ForwardSalesTradeConfirmation

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 ForwardSalesTradeConfirmationExample {
    public static void main(String[] args) {
                    		
		TradeConfTypesDef.ForwardSalesTradeConfirmation forwardSalesTradeConfirmation =
		TradeConfTypesDef.ForwardSalesTradeConfirmation
			.newBuilder()
			.setFwdTradeConfirmation(
			TradeConfTypesDef.ForwardTradeConfirmation
				.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")
					.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())
				.setLegTradeConfirmation(
				TradeConfPartsDef.LegTradeConfirmationFields
					.newBuilder()
					.addRemarks(
					TradeConfPartsDef.RemarksEntry
						.newBuilder()
						.setRemarkDateTime(Instant.now())
						.setRemarkSource("")
						.build())
					.setAccount("Garfields|GARF")
					.setAllInMidRate(BigDecimal.valueOf(1.091790))
					.setAllInRate("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(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(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(true)
						.setCanAffirm(true)
						.setCanAutoConfirm("")
						.setCanCancel("")
						.setCanConfirm(true)
						.setCanDispute("")
						.setCanReplace("")
						.setCanUnconfirm("")
						.setConfirmedBy("")
						.setConfirmedDateTime(Instant.now())
						.setIsPayNetted(true)
						.setIsPayNettingRequired("")
						.setIsPaySplit("")
						.setIsReceiveNetted("")
						.setIsReceiveNettingRequired("")
						.setIsReceiveSplit("")
						.setNextActionDeadline("2018-03-16T07:25:16+00:00")
						.setNextActionDeadlineDisplayTimezone("America/New_York")
						.setSettlementStatus("")
						.build())
					.setTenor("", true, true)
					.setTenorEditable()
					.setTenorRisk()
					.build())
				.setNdfLegTradeConfirmation(
				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(BigDecimal.valueOf(0.0))
					.setSettlementAmount(BigDecimal.valueOf(0.0))
					.setSettlementCurrency("GBP")
					.build())
				.setTimeOptionLegTradeConfirmation(
				TradeConfPartsDef.TimeOptionLegTradeConfirmationFields
					.newBuilder()
					.setFilledAmount(BigDecimal.valueOf(0))
					.setRemainingAmount("500")
					.setRiskDate("20160314")
					.setRiskTenor("1W")
					.setStartDate("20150620")
					.setStartTenor("1W")
					.build())
				.build())
			.setNearSalesLegTradeConfirmation(
			TradeConfPartsDef.SalesLegTradeConfirmationFields
				.newBuilder()
				.setAllInMargin(BigDecimal.valueOf(0.0), true)
				.setAllInMarginEditable()
				.setFwdMargin(BigDecimal.valueOf(0.0), true)
				.setFwdMarginEditable()
				.setTraderAllInRate("1.005390")
				.setTraderFwdPoints("0.005390")
				.build())
			.setSalesCommonFields(
			TradeConfPartsDef.SalesCommonTradeConfirmationFields
				.newBuilder()
				.setCompetition("")
				.setIsAdvised(true)
				.setProfit(BigDecimal.valueOf(1000))
				.setProfitCurrency("USD")
				.setProfitCurrencyDPS(5)
				.setProfitIsHouse("")
				.setProfitRate(BigDecimal.valueOf(1.091790))
				.setReasons("")
				.setSource("")
				.setSpotMargin("", true)
				.setSpotMarginEditable()
				.setTraderRemarks("")
				.setTraderSpotRate(BigDecimal.valueOf(1.09174))
				.build())
			.build();
            
    }
}