rust-ibapi
rust-ibapi copied to clipboard
Is it possible to place algo strategy orders eg VWAP/TWAP?
If not, any plan to support this in the future?
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.