| Crates.io | tradestation |
| lib.rs | tradestation |
| version | 0.0.8 |
| created_at | 2024-09-28 20:19:19.434678+00 |
| updated_at | 2025-09-01 17:38:22.067292+00 |
| description | An ergonomic Rust client for the TradeStation API. |
| homepage | https://crates.io/crates/tradestation |
| repository | https://github.com/antonio-hickey/tradestation-rs |
| max_upload_size | |
| id | 1390335 |
| size | 543,519 |
An ergonomic Rust client for the TradeStation API empowering you to build fast, scalable, and production ready trading systems and applications.
Use cargo CLI:
cargo add tradestation
Or manually add it into your Cargo.toml:
[dependencies]
tradestation = "0.0.8"
For more thorough information, read the docs.
Simple example for streaming bars of trading activity:
use tradestation::{
responses::market_data::StreamBarsResp,
market_data::{BarUnit, StreamBarsQueryBuilder},
token::{Token, Scope},
ClientBuilder, Error,
};
#[tokio::main]
async fn main() -> Result<(), Error> {
// Build the TradeStation Client
let mut client = ClientBuilder::new()
.credentials("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY")
.with_token(Token {
access_token: "YOUR_ACCESS_TOKEN".into(),
refresh_token: "YOUR_REFRESH_TOKEN".into(),
id_token: "YOUR_ID_TOKEN".into(),
token_type: String::from("Bearer"),
scope: vec![Scope::MarketData],
expires_in: 1200,
})
.build()
.await?;
// Build a query to stream Crude Oil Futures
let stream_bars_query = StreamBarsQueryBuilder::new()
.symbol("CLX30")
.unit(BarUnit::Minute)
.interval(240)
.build()?;
// Stream the bars based on the query built above into
// a custom function to process each bar streamed in.
client
.stream_bars_into(&stream_bars_query, |stream_event| {
println!("Stream Bar Event: {stream_event:?}");
Ok(())
})
.await?;
Ok(())
}
There are many ways to contribute like reporting issues, writing documentation, building out new features and abstractions, refactoring to improve on current abstractions, or fixing bugs.
Keep an eye out on open issues :)