Caplin FXIntegrationAPI Documentation - Version 8.9.0
Message Builder Example - SalesTradeConfirmation
package com.caplin.examples.fxapi.generated.motif.mm.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.mm.settlementinstructions.SettlementInstructionsPartsDef;
import com.caplin.generated.motif.mm.tradeconfirmation.TradeConfPartsDef;
import com.caplin.generated.motif.mm.tradeconfirmation.TradeConfTypesDef;
public class SalesTradeConfirmationExample {
public static void main(String[] args) {
TradeConfTypesDef.SalesTradeConfirmation salesTradeConfirmation =
TradeConfTypesDef.SalesTradeConfirmation
.newBuilder()
.setSalesCommonFields(
TradeConfPartsDef.SalesCommonTradeConfirmationFields
.newBuilder()
.setDisplayFields(addDefaultSalesAllocationDetailsUpdateFields(/* See DefaultDisplayFields javadoc for parameters and available builder methods. */))
.setInterestMargin("", true)
.setInterestMarginEditable()
.setProfit(BigDecimal.valueOf(1000))
.setProfitCurrency("USD")
.setProfitCurrencyDPS(5)
.setProfitIsHouse(true)
.setProfitRate(BigDecimal.valueOf(1.091790))
.setReasons("")
.setStreamingMode("MANUAL, STREAMING")
.setTradeStatus("AWAITING-PRICE")
.setTraderInterestRate("")
.build())
.setTradeConfirmation(
TradeConfTypesDef.TradeConfirmation
.newBuilder()
.addSettlementTradeFields(
SettlementInstructionsPartsDef.SettlementTradeFields
.newBuilder()
.setCanAffirm("")
.setIsReceiveInterestSplit("")
.setPay(
SettlementInstructionsPartsDef.SettlementFields
.newBuilder()
.setIsDefaultSettlementInstruction("")
.setSettlementDisplayName("[CCY] Account 1")
.setSettlementId("")
.setSettlementInstructionType("EXISTING")
.setSettlementRemarks("")
.setSettlementType("")
.build())
.setReceive(
SettlementInstructionsPartsDef.SettlementFields
.newBuilder()
.build())
.build())
.setCommonFields(
TradeConfPartsDef.CommonTradeConfirmationFields
.newBuilder()
.setAccount("Garfields|GARF")
.setAction("")
.setAllocationMode("")
.setCallAccount("")
.setCanAffirm(true)
.setCanCapitalIncrease("")
.setCanChangeSSI(true)
.setCanConfirm("")
.setCanGiveNotice("")
.setCanRollOver(true)
.setConfirmedBy("")
.setConfirmedDateTime("2018-03-16T07:25:16+00:00")
.setCurrency("USD")
.setDisplayFields(addDefaultSalesAllocationDetailsUpdateFields(/* See DefaultDisplayFields javadoc for parameters and available builder methods. */))
.setEntityDescription("Customer 1")
.setEntityId("CUSTONE")
.setExecutionDateTime("20160322123621")
.setHasPostTradeHistory("")
.setIndicativeProfitRate("")
.setInterestAmount("")
.setInterestRate(BigDecimal.valueOf(0.0))
.setInterestRateDPS("")
.setIsShariaTrade("")
.setMaturityDate("")
.setMaturityTenor("")
.setNoticePeriod("")
.setNoticePeriodDescription("")
.setNumberOfDays("")
.setPaymentFrequency("")
.setPrincipalAmount("")
.setPrincipalPlusInterest(BigDecimal.valueOf(0.0))
.setQuoteDateTime("")
.setQuoteID("")
.setStartDate("20150620")
.setStartTenor("1W")
.setTOBOUser("client@customer.co.za")
.setTags(Arrays.asList(/* ... */))
.setTradeDate("20160314")
.setTradeID("00001561")
.setTraderUsername("sales_trader@novobank.co.za")
.setTradingType("")
.build())
.setSettlementTradeFields(
SettlementInstructionsPartsDef.SettlementTradeFields
.newBuilder()
.build(), 0)
.build())
.build();
}
}