Caplin FXIntegrationAPI Documentation - Version 8.12.0
Message Builder Example - SpotTradeDetails
package com.caplin.examples.fxapi.generated.motif.fx.tradedetails.TradeDetailsTypesDef;
import java.math.BigInteger;
import static com.caplin.motif.fx.config.DefaultDisplayFields.addDefaultSalesAllocationDetailsUpdateFields;
import com.caplin.generated.motif.fx.tradedetails.TradeDetailsPartsDef;
import com.caplin.generated.motif.fx.tradedetails.TradeDetailsTypesDef;
public class SpotTradeDetailsExample {
public static void main(String[] args) {
TradeDetailsTypesDef.SpotTradeDetails spotTradeDetails =
TradeDetailsTypesDef.SpotTradeDetails
.newBuilder()
.setCommonTradeDetailsFields(
TradeDetailsPartsDef.CommonTradeDetailsFields
.newBuilder()
.setAccount("Garfields|GARF")
.setEntityDescription("Customer 1")
.setEntityId("CUSTONE")
.setLastActionDateTime("")
.setOneWayDirection("")
.setRequestedDateTime("")
.setTOBOUser("client@customer.co.za")
.setTraderUsername("sales_trader@novobank.co.za")
.build())
.setInterventionTradeDetailsFields(
TradeDetailsPartsDef.InterventionTradeDetailsFields
.newBuilder()
.setCompetition(true)
.setDealable(true)
.setDisplayFields(addDefaultSalesAllocationDetailsUpdateFields(/* See DefaultDisplayFields javadoc for parameters and available builder methods. */))
.setEntityDescription("Customer 1")
.setIntervenerUsername("head_trader@novobank.co.za")
.setInterventionMode("")
.setInterventionStatus("")
.setInterventionTradingType("")
.setPricingMode("AUTO")
.setPrimaryReason("This trade exceeds the GFA")
.setReasons("Customer Initiated")
.setSource("WMR 8am London Time")
.setTradeRequestID("")
.setTradeStatus("AWAITING-PRICE")
.build())
.setLegTradeDetails(
TradeDetailsPartsDef.LegTradeDetailsFields
.newBuilder()
.setAccount("Garfields|GARF")
.setAmount(BigDecimal.valueOf(0))
.setBuySell("")
.setEntityId("CUSTONE")
.setFixingDate("20150620")
.setIsTimeOption("true")
.setSettlementDate("")
.setStartDate("20150620")
.setStartTenor("1W")
.setTOBOUser("client@customer.co.za")
.setTenor("1M")
.build())
.setTradeDetailsFields(
TradeDetailsPartsDef.TradeDetailsFields
.newBuilder()
.setCurrencyPair("")
.setDealtCurrency("GBP")
.setTradingType("")
.build())
.build();
}
}