Package ch.aonyx.broker.ib.api

Examples of ch.aonyx.broker.ib.api.RequestException


    }

    private void checkAlgorithmOrderSupport() {
        if (StringUtils.isNotEmpty(order.getAlgorithmStrategy())) {
            if (!Feature.ALGORITHM_ORDER.isSupportedByVersion(getServerCurrentVersion())) {
                throw new RequestException(ClientMessageCode.UPDATE_TWS, "It does not support algo orders.", this);
            }
        }
    }
View Full Code Here


    }

    private void checkNotHeldSupport() {
        if (order.isNotHeld()) {
            if (!Feature.NOT_HELD.isSupportedByVersion(getServerCurrentVersion())) {
                throw new RequestException(ClientMessageCode.UPDATE_TWS, "It does not support notHeld parameter.", this);
            }
        }
    }
View Full Code Here

    private void checkSecurityIdTypeSupport() {
        if (StringUtils.isNotEmpty(contract.getSecurityIdentifierCode().getAcronym())
                || StringUtils.isNotEmpty(contract.getSecurityId())) {
            if (!Feature.SECURITY_ID_TYPE.isSupportedByVersion(getServerCurrentVersion())) {
                throw new RequestException(ClientMessageCode.UPDATE_TWS,
                        "It does not support secIdType and secId parameters.", this);
            }
        }
    }
View Full Code Here

    }

    private void checkPlaceOrderByContractIdSupport() {
        if (contract.getId() > 0) {
            if (!Feature.PLACE_ORDER_BY_CONTRACT_ID.isSupportedByVersion(getServerCurrentVersion())) {
                throw new RequestException(ClientMessageCode.UPDATE_TWS, "It does not support conId parameter.", this);
            }
        }
    }
View Full Code Here

    }

    private void checkSaleShortSupport() {
        if (!Feature.SHORT_SALE_EXEMPT_ORDER.isSupportedByVersion(getServerCurrentVersion())) {
            if (order.getExemptionCode() != -1) {
                throw new RequestException(ClientMessageCode.UPDATE_TWS, "It does not support exemptCode parameter.",
                        this);
            }
            if (!contract.getComboLegs().isEmpty()) {
                for (final ComboLeg comboLeg : contract.getComboLegs()) {
                    if (comboLeg.getExemptionCode() != -1) {
                        throw new RequestException(ClientMessageCode.UPDATE_TWS,
                                "It does not support exemptCode parameter.", this);
                    }
                }
            }
        }
View Full Code Here

    }

    private void checkHedgeOrderSupport() {
        if (StringUtils.isNotEmpty(order.getHedgeType().getInitial())) {
            if (!Feature.HEDGING_ORDER.isSupportedByVersion(getServerCurrentVersion())) {
                throw new RequestException(ClientMessageCode.UPDATE_TWS, "It does not support hedge orders.", this);
            }
        }
    }
View Full Code Here

    }

    private void checkOptOutSmartRoutingSupport() {
        if (order.isOptOutSmartRouting()) {
            if (!Feature.OPT_OUT_DEFAULT_SMART_ROUTING_ASX_ORDER.isSupportedByVersion(getServerCurrentVersion())) {
                throw new RequestException(ClientMessageCode.UPDATE_TWS,
                        "It does not support optOutSmartRouting parameter.", this);
            }
        }
    }
View Full Code Here

    private void checkDeltaNeutralOrderByContractIdSupport() {
        if ((order.getDeltaNeutralContractId() > 0) || StringUtils.isNotEmpty(order.getDeltaNeutralSettlingFirm())
                || StringUtils.isNotEmpty(order.getDeltaNeutralClearingAccount())
                || StringUtils.isNotEmpty(order.getDeltaNeutralClearingIntent())) {
            if (!Feature.DELTA_NEUTRAL_COMBO_ORDER_BY_CONTRACT_ID.isSupportedByVersion(getServerCurrentVersion())) {
                throw new RequestException(
                        ClientMessageCode.UPDATE_TWS,
                        "It does not support deltaNeutral parameters: ConId, SettlingFirm, ClearingAccount, ClearingIntent.",
                        this);
            }
        }
View Full Code Here

                    || (order.getScalePriceAdjustInterval() != Integer.MAX_VALUE)
                    || (order.getScaleProfitOffset() != Double.MAX_VALUE) || order.isScaleAutoReset()
                    || (order.getScaleInitPosition() != Integer.MAX_VALUE)
                    || (order.getScaleInitFillQuantity() != Integer.MAX_VALUE) || order.isScaleRandomPercent()) {
                if (!Feature.SCALE_ORDERS.isSupportedByVersion(getServerCurrentVersion())) {
                    throw new RequestException(ClientMessageCode.UPDATE_TWS,
                            "It does not support Scale order parameters: PriceAdjustValue, PriceAdjustInterval, "
                                    + "ProfitOffset, AutoReset, InitPosition, InitFillQty and RandomPercent.", this);
                }
            }
        }
View Full Code Here

            final List<OrderComboLeg> orderComboLegs = order.getOrderComboLegs();
            if (!orderComboLegs.isEmpty()) {
                for (final OrderComboLeg orderComboLeg : orderComboLegs) {
                    if (orderComboLeg.getPrice() != Double.MAX_VALUE) {
                        if (!Feature.ORDER_COMBO_LEGS_PRICE.isSupportedByVersion(getServerCurrentVersion())) {
                            throw new RequestException(ClientMessageCode.UPDATE_TWS,
                                    "It does not support per-leg prices for order combo legs.", this);
                        }
                    }
                }
            }
View Full Code Here

TOP

Related Classes of ch.aonyx.broker.ib.api.RequestException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.