コード例 #1
0
 private void appendCombo(final RequestBuilder builder) {
   if (SecurityType.COMBO.equals(contract.getSecurityType())) {
     builder.append(contract.getComboLegs().size());
     for (final ComboLeg comboLeg : contract.getComboLegs()) {
       builder.append(comboLeg.getContractId());
       builder.append(comboLeg.getRatio());
       builder.append(comboLeg.getOrderAction().getAbbreviation());
       builder.append(comboLeg.getExchange());
     }
   }
 }
コード例 #2
0
 private void appendUnderlyingCombo(final RequestBuilder builder) {
   if (Feature.DELTA_NEUTRAL_COMBO_ORDER.isSupportedByVersion(getServerCurrentVersion())) {
     final UnderlyingCombo underComp = contract.getUnderlyingCombo();
     if (underComp != null) {
       builder.append(true);
       builder.append(underComp.getContractId());
       builder.append(underComp.getDelta());
       builder.append(underComp.getPrice());
     } else {
       builder.append(false);
     }
   }
 }
コード例 #3
0
 private RequestBuilder createRequestBuilder() {
   final RequestBuilder builder = new ByteArrayRequestBuilder();
   checkDeltaNeutralOrderSupport();
   checkContractIdSupport();
   builder.append(OutgoingMessageId.MARKET_DATA_SUBSCRIPTION_REQUEST.getId());
   builder.append(VERSION);
   builder.append(toInternalId(getId()));
   appendContract(builder);
   appendCombo(builder);
   appendUnderlyingCombo(builder);
   appendReturnedTickTypeFilters(builder);
   builder.append(snapshot);
   return builder;
 }
コード例 #4
0
 private void appendContract(final RequestBuilder builder) {
   if (Feature.MARKET_DATA_REQUEST_BY_CONTRACT_ID.isSupportedByVersion(
       getServerCurrentVersion())) {
     builder.append(contract.getId());
   }
   builder.append(contract.getSymbol());
   builder.append(contract.getSecurityType().getAbbreviation());
   builder.append(contract.getExpiry());
   builder.append(contract.getStrike());
   builder.append(contract.getOptionRight().getName());
   builder.append(contract.getMultiplier());
   builder.append(contract.getExchange());
   builder.append(contract.getPrimaryExchange());
   builder.append(contract.getCurrencyCode());
   builder.append(contract.getLocalSymbol());
 }
コード例 #5
0
 private void appendReturnedTickTypeFilters(final RequestBuilder builder) {
   String returnedTickTypeFilterCommaSeparatedList = null;
   if ((returnedTickTypeFilters != null) && (returnedTickTypeFilters.length > 0)) {
     final List<String> returnedTickTypeFilterValues =
         Lists.transform(
             Lists.newArrayList(returnedTickTypeFilters), returnedTickTypeFilterToStringFunction);
     returnedTickTypeFilterCommaSeparatedList =
         StringUtils.join(returnedTickTypeFilterValues, ',');
   }
   builder.append(returnedTickTypeFilterCommaSeparatedList);
 }