use tradestation_api::{Client, Credentials, OrderRequest, Scope, TimeInForce};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client_id =
std::env::var("TRADESTATION_CLIENT_ID").unwrap_or_else(|_| "YOUR_CLIENT_ID".to_string());
let client_secret = std::env::var("TRADESTATION_CLIENT_SECRET")
.unwrap_or_else(|_| "YOUR_CLIENT_SECRET".to_string());
let creds = Credentials::new(client_id, client_secret);
println!("Authorization URL:");
println!("{}", creds.authorization_url(&Scope::defaults()));
let _order = OrderRequest {
account_id: "SIM123456".into(),
symbol: "AAPL".into(),
quantity: "10".into(),
order_type: "Market".into(),
trade_action: "BUY".into(),
time_in_force: TimeInForce::day(),
limit_price: None,
stop_price: None,
};
let _client = Client::new(creds).with_sim();
println!("(See README for full order placement flow)");
Ok(())
}