Package com.ib.client

Examples of com.ib.client.Order


            eClientSocket.eDisconnect();
        }
    }

    protected Order createOrder(String action, int quantity, String orderType) {
        Order order = new Order();

        order.m_action = action;
        order.m_totalQuantity = quantity;
        order.m_orderType = orderType;
        // order.m_transmit = true;
View Full Code Here


    this.iBOrder = iBOrder;
    this.constantTranslator = constantTranslator;
  }

  public IBOrder(IContract contract, IBConstantTranslator constantTranslator) {
    this(contract, new Order(), constantTranslator);
  }
View Full Code Here

  public static Order toIBOrder(IOrder order, IBConstantTranslator constantTranslator) {
    if (order instanceof IBOrder) {
      return ((IBOrder) order).iBOrder;
    } else {
      IBOrder iBOrder = new IBOrder(null, new Order(), constantTranslator);
      iBOrder.setAmount(order.getAmount());
      iBOrder.setSide(order.getSide());
      iBOrder.setType(order.getType());
      iBOrder.setAuxPrice(iBOrder.getAuxPrice());
      if (OrderType.LIMIT.equals(iBOrder.getType())) {
View Full Code Here

    return id;
  }

  @Override
  public String sendOrder(IOrder order) throws ConnectException, RequestFailedException {
    Order iBOrder = IBOrder.toIBOrder(order, constantTranslator);
    Contract iBContract = IBContract.toIBContract(order.getContract(), constantTranslator);
    int id = sendOrder(iBOrder, iBContract);
    iBOrder.m_orderId = id;
    sentOrders.put(id, new IBOrder(order.getContract(), iBOrder, constantTranslator));
    logger.log(Level.INFO, "Sent order: " + id);
View Full Code Here

    return Integer.toString(id);
  }
 
  @Override
  public String[] sendBracketOrders(IOrder parent, IOrder[] children) throws ConnectException, RequestFailedException {
    Order iBParentOrder = IBOrder.toIBOrder(parent, constantTranslator);
    Contract iBParentContract = IBContract.toIBContract(parent.getContract(), constantTranslator);
   
    int parentId = sendOrder(iBParentOrder, iBParentContract);
   
    String[] ids = new String[1 + children.length];
    ids[0] = Integer.toString(parentId);
   
    for (int i = 0; i < children.length; i++) {
      Order iBChildOrder = IBOrder.toIBOrder(children[i], constantTranslator);
      iBChildOrder.m_parentId = parentId;
      Contract iBChildContract = IBContract.toIBContract(children[i].getContract(), constantTranslator);
      int childId = sendOrder(iBChildOrder, iBChildContract);
      ids[i + 1] = Integer.toString(childId);
    }
View Full Code Here

TOP

Related Classes of com.ib.client.Order

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.