ibapi 1.2.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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use ibapi::{contracts::Contract, Client};

// This example demonstrates how live news for a contract can be requested.

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

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

    let contract = Contract::stock("AAPL");
    let provider_codes = ["DJ-N"];

    let subscription = client.contract_news(&contract, &provider_codes).expect("request contract news failed");
    for article in subscription {
        println!("{:?}", article);
    }
}