ibapi 2.11.1

A Rust implementation of the Interactive Brokers TWS API, providing a reliable and user friendly interface for TWS and IB Gateway. Designed with a focus on simplicity and performance.
Documentation
//! Sync Account Updates Multi example
//!
//! # Usage
//!
//! ```bash
//! cargo run --features sync --example account_updates_multi
//! ```

use ibapi::accounts::{types::AccountId, AccountUpdateMulti};
use ibapi::client::blocking::Client;

fn main() {
    env_logger::init();

    let client = Client::connect("127.0.0.1:4002", 100).expect("connection failed");

    let account = Some(AccountId("DU1234567".to_string()));

    let subscription = client
        .account_updates_multi(account.as_ref(), None)
        .expect("error requesting account updates multi");
    for update in &subscription {
        println!("{update:?}");

        // stop after full initial update
        if let AccountUpdateMulti::End = update {
            subscription.cancel();
        }
    }
}