rust-ibapi icon indicating copy to clipboard operation
rust-ibapi copied to clipboard

Is it possible to place algo strategy orders eg VWAP/TWAP?

Open craigp318 opened this issue 1 month ago • 1 comments

If not, any plan to support this in the future?

craigp318 avatar Nov 22 '25 14:11 craigp318

I'll keep this open since support for building algo orders with the builder pattern would be nice to have. However, you currently build the Order struct manually to submit algo orders.

Using example from interactive brokers: https://interactivebrokers.github.io/tws-api/ibalgos.html#vwap

You could build a similar order as follows:

use ibapi::orders::{Order, Action, TagValue};

let order = Order{
    order_type: "LMT".to_string(),
    action: Action::Buy,
    total_quantity: 1000.0,
    limit_price: Some(1.0),
    algo_strategy: "Vwap".to_string(),
    algo_params: vec![
        TagValue{tag: "maxPctVol".to_string(), value: "0.2".to_string()},
        TagValue{tag: "startTime".to_string(), value: "09:00:00 US/Eastern".to_string()},
        TagValue{tag: "endTime".to_string(), value: "16:00:00 US/Eastern".to_string()},
        TagValue{tag: "allowPastEndTime".to_string(), value: "1".to_string()},
        TagValue{tag: "noTakeLiq".to_string(), value: "1".to_string()},
        TagValue{tag: "speedUp".to_string(), value: "1".to_string()},
    ],
    ..Default::default()
};

And submit using the place_order API.

wboayue avatar Nov 22 '25 19:11 wboayue