alpaca_api_client 0.8.0

Unofficial Alpaca API Client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use alpaca_api_client::stream::TradeUpdateStream;
use alpaca_api_client::trading::AccountType;

fn main() {
    println!("Connecting to trade updates stream...");

    TradeUpdateStream::new(AccountType::Paper)
        .start(|update| {
            println!(
                "[{}] {} - {} @ {}",
                update.event,
                update.order.symbol,
                update.order.side,
                update.price.unwrap_or_default()
            );
        })
        .unwrap();
}