How to replace order with IB Java API

Discussion in 'Automated Trading' started by dloyer, Jul 20, 2010.

  1. dloyer

    dloyer

    How can I update a stop price of a order using IB's Java API?

    I currently cancel the order, then replace it with the new stop price. It works fine.

    Now with IB's new focus on the ratio of orders to fills, I could do the same thing and replace two order actions with one if I can do a modify.

    I didnt see anything in the API documentation for this.

    Does anyone use the Java API to modify a stop price?
     
  2. to modify the price or size of an order that is already sent.... you just resend the new information with the old order id...


    Code:
    long id = 5;
    sendorder(new BuyStop(symbol,price,size,id));
    
    // move price up a dollar
    sendorder(new BuyStop(symbol,price+1,size,id));
    
    http://tradelink.googlecode.com
     
  3. dloyer

    dloyer

    Hmmm. Thanks. I dont use trade link, but I will try that...
     
  4. it's a feature of the IB api, so it should work with java as well. we just pass that feature through in tradelink.