ibapi 0.2.3

A synchronous implementation of the Interactive Brokers TWS API.
Documentation
1
2
3
4
5
6
7
8
9
10
use ibapi::Client;

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

    let positions = client.positions().expect("request failed");
    for position in positions {
        println!("{:4} {:4} @ {}", position.position, position.contract.symbol, position.average_cost)
    }
}