ibapi 2.11.2

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
//! Histogram Data example
//!
//! # Usage
//!
//! ```bash
//! cargo run --features sync --example histogram_data
//! ```

use ibapi::client::blocking::Client;
use ibapi::prelude::*;

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

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

    let contract = Contract::stock("GM").build();

    let histogram = client
        .histogram_data(&contract, TradingHours::Regular, HistoricalBarSize::Week)
        .expect("histogram request failed");

    for item in &histogram {
        println!("{item:?}");
    }
}