Caplin FXIntegrationAPI Documentation - Version 6.2.0
Message Builder Example - AllocationForwardSalesDetailsUpdate
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 AllocationForwardSalesDetailsUpdateExample {
public static void main(String[] args) {
TradeConfTypesDef.AllocationForwardSalesDetailsUpdate allocationForwardSalesDetailsUpdate =
TradeConfTypesDef.AllocationForwardSalesDetailsUpdate
.newBuilder()
.setDisplayFields(addDefaultSalesAllocationDetailsUpdateFields(/* See DefaultDisplayFields javadoc for parameters and available builder methods. */))
.setForwardSalesTradeConfirmation(
TradeConfTypesDef.ForwardSalesTradeConfirmation
.newBuilder()
.setFwdTradeConfirmation(
TradeConfTypesDef.ForwardTradeConfirmation
.newBuilder()
.setCommonFields(
TradeConfPartsDef.CommonTradeConfirmationFields
.newBuilder()
.setAccount("", true)
.setAccountEditable()
.setAllocationSettlementDateOptions("ORIGINAL,EARLIER,LATER")
.setAssetType("")
.setBackOfficeID("")
.setCanAllocate("")
.setClient("")
.setClientAgreementDateTime(Instant.now(), true)
.setClientAgreementDateTimeEditable()
.setContraCostAmount(BigDecimal.valueOf(0.0))
.setContraCostCurrency(BigDecimal.valueOf(0.0))
.setContraCostPercentage("1.5")
.setCostAmount(BigDecimal.valueOf(12412891.31))
.setCostCurrency("GBP")
.setCostCurrencyDPS(2)
.setCostPercentage("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("")
.setIsCancellable(true)
.setIsReversible("")
.setNumberOfPips("2")
.setOrderID("")
.setOriginalTradeID("")
.setPostTradeType("")
.setPriceSource("st1@caplin.com")
.setPurpose("Commercial")
.setRemarks("")
.setSpotMidRate("1.08345")
.setSpotRate("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("2018-03-16T07:25:16+00:00")
.setRemarkSource("")
.build())
.setAccount("Garfields|GARF")
.setAdjustedSwapPoints("")
.setAllInMidRate("1.091790")
.setAllInRate("1.091790")
.setAllInRateDPS("5")
.setAllocatableAmount(BigDecimal.valueOf(500))
.setAllocatableContraAmount(BigDecimal.valueOf(500))
.setAmount(BigDecimal.valueOf(0.0), true, true)
.setAmountEditable()
.setAmountRisk()
.setBuySell("")
.setContraAmount(BigDecimal.valueOf(500))
.setContraCostAmount(BigDecimal.valueOf(0.0))
.setContraCostCurrency("")
.setContraCostPercentage("1.5")
.setCostAmount(BigDecimal.valueOf(12412891.31))
.setCostCurrency("GBP")
.setCostPercentage("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("1000")
.setRemainingAmount(BigDecimal.valueOf(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(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("0")
.setBuySell("")
.setTradeID("00001561")
.build())
.addReceive(
SettlementInstructionsPartsDef.SettlementFields
.newBuilder()
.build())
.addReceiveNettingComponents(
SettlementInstructionsPartsDef.NettingComponents
.newBuilder()
.build())
.setAffirmedBy("")
.setAffirmedDateTime(Instant.now())
.setCanAdHoc(true)
.setCanAffirm(true)
.setCanAutoConfirm(true)
.setCanCancel("")
.setCanConfirm(true)
.setCanDispute("")
.setCanReplace("")
.setCanUnconfirm("")
.setConfirmedBy("")
.setConfirmedDateTime("2018-03-16T07:25:16+00:00")
.setIsPayNetted(true)
.setIsPayNettingRequired(true)
.setIsPaySplit(true)
.setIsReceiveNetted(true)
.setIsReceiveNettingRequired(true)
.setIsReceiveSplit("")
.setNextActionDeadline(Instant.now())
.setNextActionDeadlineDisplayTimezone("America/New_York")
.setSettlementStatus("")
.build())
.setStartDate("20150620")
.setStartDateRisk()
.setStartTenor("1W")
.setStartTenorRisk()
.setTOBOUser("", true, true)
.setTOBOUserEditable()
.setTOBOUserRisk()
.setTenor("1M")
.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("")
.setSettlementAmount(BigDecimal.valueOf(0.0))
.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("20150620")
.setStartDateRisk()
.setStartTenor("1W")
.setStartTenorRisk()
.build())
.build())
.setNearSalesLegTradeConfirmation(
TradeConfPartsDef.SalesLegTradeConfirmationFields
.newBuilder()
.addTraderRemarks(
TradeConfPartsDef.RemarksEntry
.newBuilder()
.build())
.setAdjustedSwapMargin(BigDecimal.valueOf(0.0))
.setAdjustedTraderSwapPoints("")
.setAllInMargin(BigDecimal.valueOf(0.0), true)
.setAllInMarginEditable()
.setFwdMargin(BigDecimal.valueOf(0.000019))
.setFwdMarginEditable()
.setOriginalMargin(BigDecimal.valueOf(0.0))
.setTOBOUser("client@customer.co.za")
.setTOBOUserEditable()
.setTOBOUserRisk()
.setTraderAllInRate(BigDecimal.valueOf(1.005390))
.setTraderFwdPoints(BigDecimal.valueOf(0.005390))
.setTraderOriginalRate("")
.build())
.setSalesCommonFields(
TradeConfPartsDef.SalesCommonTradeConfirmationFields
.newBuilder()
.setCompetition("")
.setIsAdvised(true)
.setProfit("1000")
.setProfitCurrency("USD")
.setProfitCurrencyDPS(5)
.setProfitIsHouse("")
.setProfitRate("1.091790")
.setReasons("")
.setSource("WMR 8am London Time")
.setSpotMargin("", true)
.setSpotMarginEditable()
.setStreamingMode("MANUAL, STREAMING")
.setTraderSpotAskRate(BigDecimal.valueOf(1.08575))
.setTraderSpotBidRate(BigDecimal.valueOf(1.08575))
.setTraderSpotRate("1.09174")
.build())
.build())
.build();
}
}